[prev in list] [next in list] [prev in thread] [next in thread] 

List:       markdown-discuss
Subject:    Re: Newline before </code></pre>
From:       Michel Fortin <michel.fortin () michelf ! com>
Date:       2006-07-03 3:05:27
Message-ID: AE55BD00-B5BA-4B77-BD3B-9F2E2C2AC57B () michelf ! com
[Download RAW message or body]

Le 2 juil. 2006 à 18:32, Jon Noring a écrit :

> Now, I don't know the reason in Perl or PHP markdown for preserving
> CR/LF characters using <pre>, but there must be some reason. I'm
> only trying to give some background information.

The reason PHP Markdown does it is because Markdown does it. I think  
two things may have weighted for this behaviour in Markdown:

*   It generates undoubtedly prettier code to look at and with HTML  
(or XHTML
     served as text/html as everyone does) it changes nothing. I  
suppose,
     until now, no one bothered to check the result with true XHTML  
served as
     XML.

*   It may have been found safer regarding the _HashHTMLBlocks function
     which handle code blocks whether they are part of the input or were
     generated by Markdown. While in its current form _HashHTMLBlocks  
can
     handle `</pre></code>` just fine without the preceding newline,  
it may
     not have always be the case.

In any case, neither of these reasons holds if the end result in the  
browser is not right. So I agree the newline should be removed to  
solve the XHTML problem. I'll probably do that in the next version of  
PHP Markdown. I may do a new version on my own soon, as the bug list  
keeps growing.


Michel Fortin
michel.fortin@michelf.com
http://www.michelf.com/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic