Whenever I try to use <a>, <em>, <sup>, or <sub> tags (or probably any other inline tag), Drupal inserts a space before the HTML tag. This does not happen within the node but rather upon the HTML rendering.

For instance:

234<sup>2</sup> in the body field

is rendered as

234 <sup>2</sup> on the page

Any idea why this would be or what I can do to eliminate the space that is being added? I have TinyMCE installed on the site, but (long story) it is disabled so that I input everything in raw HTML.


If you use "Full HTML" text input rather than "Filtered HTML", then Drupal won't parse or modify your markup.

  • It's adding the space regardless of whether I have chosen Full HTML.
    – rrr45
    Oct 24 '13 at 20:39
  • Are you sure that output isn't cached? View the page with an argument to break the cache, like ?asdf at the end of the URL. If it isn't cached, something else must be acting on it, maybe in the theme? I just tested this on a standard Drupal 7.23 site with Bartik and was unable to replicate the behavior you've described.
    – jonpeck
    Oct 24 '13 at 20:48
  • Tried adding ?asdf, and the space is still inserted. Not sure what's going on. It's not the theme, because it's an actual space that I can select individually. Might have to take a look at modules I guess.
    – rrr45
    Oct 24 '13 at 21:19
  • The space is visible when you view the page source, not just inspect the element?
    – jonpeck
    Oct 24 '13 at 21:21
  • That's correct. When I look at the Body from the Edit screen, it looks just how I want it. But when I view the page source from the rendered page, there is a space. Weird, I know.
    – rrr45
    Oct 24 '13 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.