markdown-it-sup icon indicating copy to clipboard operation
markdown-it-sup copied to clipboard

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

Open aboks opened this issue 1 year ago • 0 comments

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?

aboks avatar Apr 25 '23 14:04 aboks