johnxnguyen / Down

Blazing fast Markdown / CommonMark rendering in Swift, built upon cmark.
Other
2.24k stars 319 forks source link

Is it possible to use superscripts or subscripts with this library? If so how? If not, we'd love the feature! #257

Closed Ryanauger95 closed 3 years ago

Ryanauger95 commented 3 years ago

Feature Request

Superscript / Subscript support, like Github's markdown, or even using inline HTML

johnxnguyen commented 3 years ago

Hi @Ryanauger95 , thanks for getting in touch. Unfortunately superscripts and subscripts are not part of the Commonmark specification.

It may be possible (I haven't tried it) to use inline html, but it only when using the DownView which uses a web view to render the content. However, if you rely on using the DownStyler it certainly won't work because this flavor or the markdown rendering doesn't support html parsing.

In terms of adding support for this, it's something that needs to be done in the cmark parser, which I don't intend to do here because Down is only a wrapper around cmark.

I hope this answers you questions.

Ryanauger95 commented 3 years ago

This does help - I appreciate the quick reply. I figured we could use special unicode superscript characters On May 31, 2021, 3:57 AM -0400, John Nguyen @.***>, wrote:

Hi @Ryanauger95 , thanks for getting in touch. Unfortunately superscripts and subscripts are not part of the Commonmark specification. It may be possible (I haven't tried it) to use inline html, but it only when using the DownView which uses a web view to render the content. However, if you rely on using the DownStyler it certainly won't work because this flavor or the markdown rendering doesn't support html parsing. In terms of adding support for this, it's something that needs to be done in the cmark parser, which I don't intend to do here because Down is only a wrapper around cmark. I hope this answers you questions. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

johnxnguyen commented 3 years ago

@Ryanauger95 no problem, let me know if there's anything else I can help you with.