markdown-it / markdown-it-sup

Superscript (<sup>) tag plugin for markdown-it markdown parser
https://markdown-it.github.io/
MIT License
24 stars 18 forks source link

foo^*^ should not be converted to superscript according to spec #6

Open aboks opened 1 year ago

aboks commented 1 year ago

The commonmark spec for emphasis/strong (https://spec.commonmark.org/0.30/#emphasis-and-strong-emphasis) specifies in its rules that in foo*a* the first * opens emphasis, but in foo*_* it doesn't. This is because it is not a left-flanking delimiter run, as it is followed by punctuation, but not preceded by punctuation or whitespace.

In the same fashion, it would make sense for sup (and in the same sense probably also for sub) to follow the same rules, i.e. to convert foo^a^ to superscript, but not foo^*^. Pandoc, from which the superscript syntax is borrowed, also honors these rules (as can be seen in https://pandoc.org/try/).

Would it be possible to change this extension so that this rule from the spec is honored and foo^*^ is converted to <p>foo^*^</p> instead of superscript?