Should leading and trailing spaces between backticks be preserved?

David Chambers david.chambers.05 at gmail.com
Sun Feb 13 14:28:45 EST 2011


Hi folks,

Yesterday I raised an issue about inconsistent preservation of
whitespace<http://www.freewisdom.org/projects/python-markdown/Tickets/000087>in
Python-Markdown.

>>> import markdown
>>> md = markdown.Markdown()
>>> md.convert('Added `>>> ` to signify user input.')
u'<p>Added <code>&gt;&gt;&gt;</code> to signify user input.</p>'

According to Waylan, all but one of the Markdown implementations drop the
trailing slash within the backticks. This seems wrong to me. I don't buy the
argument that since default browser behaviour is to ignore this space, the
space is insignificant and can be omitted from the markup generated. This is
akin to arguing that lossy compression of audio files is fine since default
(i.e. iPod/iPhone) headphones are of low quality and make it impossible to
detect the difference between compressed and uncompressed versions.


>From a practical standpoint, it should be possible to apply styling to this

markup to drastically change its appearance. One could, for example, apply
`color` and `background-color` styles to invert the code's colours. In
conjunction with certain `white-space` values this could lead to the
following:

Added >>> to signify user input.

Given the current implementations, information which is in this case
significant has been lost by the time I get my hands on it.

*How do others feel about updating what is considered to be the correct
behaviour here?* Such a change would be backwards compatible since, as
mentioned, default browser behaviour is to ignore such spaces anyway. In
those rare cases where styling has been applied in order to make this
whitespace significant, the change is a reflection of the output's
(improved) fidelity.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20110213/ec64dd41/attachment.htm>


More information about the Markdown-Discuss mailing list