Problem background
We have just switched to using react-native-enriched-markdown to render markdown produced by our Strapi CMS. This generally works well, and supports more formatting options than our previous library, but it does not currently support the way that Strapi produces underlines, which is by using <u>...</u> tags. This is technically valid CommonMark Markdown, as laid out in the Raw HTML section of the specification, but RNEM does not render these as underlines, or consume the tag and render the text without formatting, but instead renders the tags as text:
Suggested solution
I would like to see RNEM parse <u> tags as underlines, and style them in the same way as the existing underlined elements.
| Input text |
Output |
The middle <u>two words</u> are underlined |
The middle two words are underlined |
Alternative solution
Alternatively, if that is not possible, the <u> tags should be silently discarded and the text rendered as if no style had been specified.
| Input text |
Output |
The middle <u>two words</u> are plain |
The middle two words are plain |
Additional context
According to the letter of the CommonMark specification, this should apply to all raw HTML tags provided to the parser. That would clearly be a broader change to RNEM, so I'm restricting this feature request to our specific use case. I will, however, mention a similar suggestion about <br/> tags which shares some aspects of this request.
Note that the GitHub Flavoured Markdown specification should allow <u> tags, but in fact they are consumed and the output is the same as the alternative solution above. The GitHub Markdown docs say to use <ins> tags instead.
Problem background
We have just switched to using
react-native-enriched-markdownto render markdown produced by our Strapi CMS. This generally works well, and supports more formatting options than our previous library, but it does not currently support the way that Strapi produces underlines, which is by using<u>...</u>tags. This is technically valid CommonMark Markdown, as laid out in the Raw HTML section of the specification, but RNEM does not render these as underlines, or consume the tag and render the text without formatting, but instead renders the tags as text:Suggested solution
I would like to see RNEM parse
<u>tags as underlines, and style them in the same way as the existing underlined elements.The middle <u>two words</u> are underlinedAlternative solution
Alternatively, if that is not possible, the
<u>tags should be silently discarded and the text rendered as if no style had been specified.The middle <u>two words</u> are plainAdditional context
According to the letter of the CommonMark specification, this should apply to all raw HTML tags provided to the parser. That would clearly be a broader change to RNEM, so I'm restricting this feature request to our specific use case. I will, however, mention a similar suggestion about
<br/>tags which shares some aspects of this request.Note that the GitHub Flavoured Markdown specification should allow
<u>tags, but in fact they are consumed and the output is the same as the alternative solution above. The GitHub Markdown docs say to use<ins>tags instead.