Unnecessary line-height span tags suddenly appearing in my code

  • Unknown's avatar

    When editing text in the visual editor, then switching to text, I frequently see something like this:

    <span style=”font-size: 14px; line-height: 1.5em;”>

    It seems to occur when using backspace or enter to create or delete paragraphs (i.e., if this was regular HTML, it would be the same as adding or deleting <p> tags).

    I find this behavior in all of the blogs I manage, both on wordpress.com and self-hosted. No matter what the formatting of the page, the line-height is always 1.5em when this happens.

    I don’t like to see unnecessary code, and I always remove these span tags when I see them. Why are they there? How can I prevent this from happening?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Are you copying and pasting content into posts and/or pages?

  • Unknown's avatar

    You need to be cautious and use the correct approach when copying and pasting from any document created in a word processor.

    For example Microsoft Word is a word processing program that’s not compliant with web standards. The result of copy and pasting from Microsoft Word into the Tiny MCE editor in WordPress blogs can be unexpected, and contain a lot of formatting code that’s not compliant unless you know how to use the built-in features in the Visual editor for using Word cleanly. Row 2 icon 6 (see also icon 5)
    http://en.support.wordpress.com/visual-editor/#pasting-text

    Go here and enable this > Settings > Writing
    Formatting
    _ WordPress should correct invalidly nested XHTML automatically
    “save changes”

    I recommend using Windows Live Writer for posting to your blog > http://en.support.wordpress.com/xml-rpc/windows-live-writer/

  • Unknown's avatar

    Sometimes yes, sometimes, no.

    Often I will put text in Notepad before pasting into WP to be sure of removing formatting. Often I will use the paste-as-text option.

    The issue occurs occasionally in all of the above situations. It seems to have something to do with a particular sequence of keystrokes that I think usually involves the backspace key in the visual editor.

    It has no effect on the visual appearance. It’s just code that doesn’t need to be there.

  • Unknown's avatar

    I seem to have posted under two different user names (tthsalumnifund and jlehrer1953).

    Timethief, thanks for your answer. I’m quite sure my issue does not relate to how I copy/paste because I do it so many different ways (as the situation demands) in various blogs on .com and self-hosted.

    I’m thinking this is a WP bug that started appearing for me in the past few months.

  • Unknown's avatar

    I’ll tag this thread for a Staff follow-up. Please subscribe to the thread so you are notified when they respond and please be patient while waiting.

  • Unknown's avatar
  • Is this still happening for you? If so could you point me to the specific portion of a post where the line-height is changing? That’d help me look in to the details. Thanks.

  • Unknown's avatar

    This is happening for me too. I read about it a lot and it seems an issue with TinyMCE (dunno if that’s possible, dunno if WordPress uses that).

  • Unknown's avatar

    Hi there,

    Currently there has been an update to the Editor as seen here:

    Introducing Smoother Editing and New Playlists

    This should no longer be happening! If you find any bugs, can you please report them here:

    https://en.forums.wordpress.com/topic/posting-of-word-files-with-tables?replies=6

    Thank you all!

  • The topic ‘Unnecessary line-height span tags suddenly appearing in my code’ is closed to new replies.