Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for <sub> #16

Closed
alansouzati opened this issue Feb 25, 2016 · 9 comments
Closed

Support for <sub> #16

alansouzati opened this issue Feb 25, 2016 · 9 comments
Labels
🐛 type/bug This is a problem
Milestone

Comments

@alansouzati
Copy link

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.

@rexxars
Copy link
Collaborator

rexxars commented Feb 25, 2016

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?

@alansouzati
Copy link
Author

Sorry I missed that in the original issue. It is converting sub to span

@rexxars
Copy link
Collaborator

rexxars commented Feb 25, 2016

Hrm, yeah. I really have to get the inline HTML handling fixed. No solution for this right now, unfortunately.

@rexxars rexxars added the 🐛 type/bug This is a problem label Mar 15, 2016
@kwynns
Copy link

kwynns commented Oct 27, 2016

+1 As I need support for <sup>

@localjo
Copy link

localjo commented Oct 27, 2017

I tracked this down to this line;

https://github.com/rexxars/commonmark-react-renderer/blob/master/src/commonmark-react-renderer.js#L89

It seems that all HtmlBlock and HtmlInline node types are either rendered as <div> or <span> regardless of what the original HTML was.

@localjo
Copy link

localjo commented Oct 27, 2017

@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.

@localjo
Copy link

localjo commented Oct 27, 2017

Oh, actually, this is related to rexxars/commonmark-react-renderer#9

I'll continue discussion there.

@rexxars rexxars added this to the 3.0.0 milestone Nov 11, 2017
@rexxars
Copy link
Collaborator

rexxars commented Nov 11, 2017

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 rexxars closed this as completed Nov 11, 2017
@gtsop
Copy link

gtsop commented Nov 30, 2020

@rexxars Coming into this in 2020, I don't see an easy way of using the tag other than enabling "allowDangerousHtml". Any clues here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 type/bug This is a problem
Development

No branches or pull requests

5 participants