WordPress.org

Support

Support » How-To and Troubleshooting » Does WordPress Break the `PRE` Element?

Does WordPress Break the `PRE` Element?

  • brentontherefore
    Member

    @brentontherefore

    As we all know, the HTML <pre> tag means preformatted text, and is used to do things like preserve the white-spaces in preformatted text, so that if I use spaces to align some text like this:

    0
     1
      2
       3
        4
         5
          6

    it will look like that, instead of letting HTML do it’s thing to collapse it and making it look like this:

    0 1 2 3 4 5 6

    or this

    0
    1
    2
    3
    4
    5
    6

    So why does WordPress strip out concurrent spaces before even sending code to the browser, even inside a <pre> tag? When I view the source and look at my <pre> element, the white spaces aren’t there, WordPress has entirely removed them. HTML never has a chance to preformat it, the spaces are gone. This defeats the purpose of <pre> altogether. Yet I’ve seen people using the <pre> tag on WordPress sites and their spaces show up fine. Is this something recently broken in 3.5.1??

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Does WordPress Break the `PRE` Element?’ is closed to new replies.