msmid / markdown2docbook

Conversion tool for transforming markdown text files to DocBook/HTML documents. Project is based on XSLT 2.0 technology.
MIT License
21 stars 6 forks source link

Handling of escaped chars #7

Closed msmid closed 9 years ago

msmid commented 10 years ago

Markdown supports escaping of characters including those which are used for mark up.

\ backslash ` backtick

msmid commented 10 years ago

In inline phase, I need to get rid of these "\"

Also, note that < or > will need special treatment (and others html-specific chars)

msmid commented 9 years ago

Works nicely but following structure *\*\*hello\*\** may produce <em>**hello**</em>, but it is ***hello*** instead.

Parsed characters are "taken" out of text for further parsing, so it is imposible for following functions to identify * text * markup.

msmid commented 9 years ago

Another thing is that this parsing should be invoked after codespan parsing

msmid commented 9 years ago

Analyze string was responsible for above bug, now I use replace function, which has downfall too. It must unescape characters after all other parsing, because unescaped char is still char and can be parsed as markdown.

Now it is the very last step. Parsing spans and codespans however can't recognize escaped chars and therefore using escaped like \* around these ones produce bugs.