pombreda / gitit

Automatically exported from code.google.com/p/gitit
0 stars 0 forks source link

Interpret <br> as native newline formatting #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
See issue 78 for screenshots/examples:
http://code.google.com/p/gitit/issues/detail?id=78

Newlines expressed '<br>' (as opposed to the '  $' or '$\' Markdown
conventions) vanish when going from Markdown to PDF via ConText, because
the Context generator in Pandoc discards them. '<br>' fills an
inline-newline niche ("foo<br>baz") that the other 2 conventions do not,
and so a user might want (and expect) <br> to work like the others.

That is, <br> would be treated not as raw HTML/HtmlInline but as a regular
linebreak. If pandoc is exporting to HTML, then that linebreak will get
turned right back into a <br>, and the other formats like Context will get
the linebreaks they ought to. (Offhand, I know of no situation where one
wants the <br> to go through verbatim, and which would also not see all
regular linebreaks turned into <br>s.)

(This general idea might also apply to some of the other simple HTML markup
like <i> or <b>, but probably not. Those all are inline formatting with
inline Markdown replacements.)

Original issue reported on code.google.com by gwe...@gmail.com on 21 Dec 2009 at 12:43

GoogleCodeExporter commented 9 years ago
One potential problem: Markdown is supposed to pass raw html through verbatim.
So, 
hello<br>there   ==>   hello<br>there
and
hello<br/>there ==>    hello<br/>there
We break this invariant if we parse <br> as linebreak, then print it in HTML as 
<br/>.

Original comment by fiddloso...@gmail.com on 21 Dec 2009 at 2:32

GoogleCodeExporter commented 9 years ago
But <br> and <br/> mean the same thing in both source document and output HTML, 
don't
they?

Reading through http://daringfireball.net/projects/markdown/syntax#html I get a 
vibe
that it isn't asking for an invariant that's verbatim down to the bit level, 
but that
the passed-through HTML does what it would do if one had written in raw HTML to 
begin
with; swapping <br/> for <br> would respect that.

Original comment by gwe...@gmail.com on 21 Dec 2009 at 6:02