Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Field labels have leading and trailing whitespace. When adding a collon using css, this leads to undesired results.
HTML before the patch
<div class="field-label-inline">
Date </div>
HTML after the patch
<div class="field-label-inline">Date</div>
The attached patch includes all three DS field templates. I only tested the minimal template.
Twig docs on whitespace control: http://twig.sensiolabs.org/doc/templates.html#templates-whitespace-control
Comment | File | Size | Author |
---|---|---|---|
ds-label-whitespace.patch | 1.45 KB | Sutharsan |
Comments
Comment #2
aspilicious CreditAttribution: aspilicious commentedThanks for the patch!
Comment #3
aspilicious CreditAttribution: aspilicious commentedThe expert field template needed some more love.
You learn something new every day... :)
Comment #6
newswatch CreditAttribution: newswatch commentedI don't think this has been resolved. I still get white space just before and after the output in every field-expert template.
I am using DS 8.x-3.13 on D 9.3.7 with PHP 7.4.28
Comment #7
newswatch CreditAttribution: newswatch commentedI must add this:
* This happens across my site.
* This is even when the Label is made "hidden".
* This only happens when the text input is plain text. It does not happen when the text input is Basic or Full HTML.