Support <pre> tag
See original GitHub issueHTML contains the insert code, like this: the source code of this html is a “pre” tag, i render this HTML into native views by react-native-render-html, i got this result
the render result is unfriendly, the original format is lost. i think render a HTML page which contains insert code is very common and important requirements. so i mentioned this issue, hoping to get a good answer.
Environment
React: 16.3.1
React native: 0.53.0
react-native-render-html: 3.10.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
HTML pre tag - W3Schools
The <pre> tag defines preformatted text. Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces...
Read more ><pre>: The Preformatted Text element - HTML - MDN Web Docs
The <pre> HTML element represents preformatted text which is to be presented exactly as written in the HTML file. The text is typically ......
Read more >HTML - <pre> Tag - Tutorialspoint
Description. The HTML <pre> tag is used for indicating preformatted text. · Example. Live Demo · Global Attributes. This tag supports all the...
Read more >HTML <pre> Tag - GeeksforGeeks
The <pre> tag in HTML is used to define the block of preformatted text which preserves the text spaces, line breaks, ... Supported...
Read more ><pre> Tag in HTML – Example Code - freeCodeCamp
The HTML <pre> tag defines a preformatted block of text. It comes in handy when you want to display text where the typographical...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jsamr Oh that’s great! Can’t wait to get this published, thanks for the work!
We managed to get this working by substituting newlines within pres using the
alterData
hook, then writing a custom renderer forpre
that splits these newlines back in:Step 1. replace newlines within pre text (not exact code):
Step 2. add the newlines back in with a custom renderer for pre:
Hope that helps