Forums

[resolved] Leading spaces? (4 posts)

  1. Charley Kyd
    Member
    Posted 2 years ago #

    I want to post examples of indented, single-spaced code. I've tried inserting non-breaking spaces in the HTML, but WordPress strips them out. I've tried using <div style="padding-left: 20px>, but it's a hassle to do and vertical spacing becomes a problem.

    What's the easiest way to display indented, single-spaced code?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    If using the HTML tab:

    <pre><code>
    [ code stuff ]
    </code></pre>
  3. Charley Kyd
    Member
    Posted 2 years ago #

    Thanks!

  4. jonpeltier
    Member
    Posted 2 years ago #

    I've never had any problems using WordPress up to 2.8 and TinyMCE-Advanced up to 3.2.4. In WordPress 2.9, single line breaks, whether entered as a shift-enter in Visual or HTML mode or as
    in HTML mode are stripped out. I thought at first it was TinyMCE-Advanced 3.2.7, but it breaks whether or not this is activated.

    Why does WordPress think it knows better than I how I want my HTML to look? It's getting worse than Microsoft in this regard.

Topic Closed

This topic has been closed to new replies.

About this Topic