markdown-it-sup
markdown-it-sup copied to clipboard
foo^*^ should not be converted to superscript according to spec
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?