Newline character in HtmlTag causes unwanted whitespace

Created on 2 September 2011, almost 13 years ago
Updated 21 August 2023, 10 months ago

A '\n' (newline) character is included at the end of every tag output by theme_html_tag(). This causes extra whitespace that may not always be desired. One specific example is for use with sprite icons that are included within links.

<a href="#"><span class="sprite"></span>Text</a> 

If the span above is rendered using theme_html_tag() then there will be extra whitespace between the icon and the text because of the newline character. Any spacing would be better controlled by css (margin or padding).

Related CR https://www.drupal.org/node/2019739

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Theme 

Last updated less than a minute ago

Created by

🇺🇸United States draenen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024