thephpleague / html-to-markdown

Convert HTML to Markdown with PHP
MIT License
1.77k stars 205 forks source link

how to ignore existing markdown? converter escapes any existing markdown. #160

Closed danhammari closed 6 years ago

danhammari commented 6 years ago

Is there an option where I can instruct the converter to ignore existing markdown tags? The converter likes to escape any existing markdown tags. Here is what a repeated conversion does:

  1. italic text
  2. italic text
  3. _italic text_
  4. \italic text\
  5. \_italic text\_

I would like to avoid all the escaping that goes on. This is useful for the case of a mixed html/markdown document or repeated parsing of a document.

colinodell commented 6 years ago

Unfortunately no such option exists at this time, and I'm not sure I plan to add one. Ideally, if you have both HTML and Markdown mixed in a single document, the MD should be inside a <code> block so that it is preserved.

So while I do understand your use case, I do think it falls a bit outside its intended purpose :-/