Hi is there any plans to support superscript in this markdown parser? I tried using <sub>1</sub> but this tag gets converted to even if I specify skipHTML option.
Commonmark doesn't specify any type for it, but html should be supported. I suspect the sloppy inline html parsing is causing this, but can't check right now. What does it get converted to?
Sorry I missed that in the original issue. It is converting sub to span
Hrm, yeah. I really have to get the inline HTML handling fixed. No solution for this right now, unfortunately.
+1 As I need support for <sup>
I tracked this down to this line;
It seems that all HtmlBlock and HtmlInline node types are either rendered as <div> or <span> regardless of what the original HTML was.
@rexxars Could you do a regex on props.literal to determine what kind of tag it is? Seems like props.literal.match(/[A-Z]+/i)[0] could work. Or something like props.literal.match(/^<(sup|sub|span)>$/i)[1]. I'll open a PR on commonmark-react-renderer.
Oh, actually, this is related to https://github.com/rexxars/commonmark-react-renderer/issues/9
I'll continue discussion there.
The new release candidate for v3 has (very basic) support for attributeless, inline html nodes. Please read this issue for more information. Please give it a go and let me know if you encounter issues.
@rexxars Coming into this in 2020, I don't see an easy way of using the tag other than enabling "allowDangerousHtml". Any clues here?
Most helpful comment
+1 As I need support for
<sup>