Thanks for responding so quickly!
Yeah, I get that. Currently, your code does the following:
Code: Select all
make_html('`nAn <a href="google.com">inline link</a>.`n', options, true, false)
⇨ <p>An <a href="google.com">inline link</a>.</p>
AND
make_html('`nAn *<a href="google.com">inline link</a>*.`n', options, true, false)
⇨ <p>An <em><a href="google.com">inline link</a></em>.</p>
I absolutely love the first transformation. It is consistent both with John Gruber's spec and GFM and is a 'must-have' for me. In contrast, the second transformation seems to contradict Gruber's spec where he says that Span-level HTML tags can be used anywhere in a Markdown paragraph. It also seems to contradict
the Github flavored markdown spec which says,
Text between < and > that looks like an HTML tag is parsed as a raw HTML tag and will be rendered in HTML without escaping.
* And I do confess, I'm writing this early in the morning and in a bit of a rush, so maybe I'm missing something.
As you know, inclusion of inline HTML is is an important part of Markdown. It is covered in detail in the "overview" section of
John Gruber's original introduction to Markdown syntax. I suspect this is why you usually use the
ltgt() function only within HTML attributes rather than more broadly,
except when you are processing markdown inline formatting like emphasis and strong (ie lines, lines 554, 564, 574, and 583, which I mentioned above). I'm wondering if you added those 4
ltgt() calls in your 2022/01/03 update, because, unless I'm missing something they block all inline HTML within markdown inline markdown formatting. This contradicts when Gruber wrote,
Span-level HTML tags — e.g. <span>, <cite>, or <del> — can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you’d prefer to use HTML <a> or <img> tags instead of Markdown’s link or image syntax, go right ahead.
Anyway, those are my two cents! I hope you find them helpful, but if not, no problem!