We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello Conor,
I got an error while I am using react-native-syntax-highlighter inside react-native-render-html.
react-native-syntax-highlighter
react-native-render-html
I got this error:
Here is my code
import React from 'react'; import { View } from 'react-native'; import Html from 'react-native-render-html'; import SyntaxHighlighter from 'react-native-syntax-highlighter'; const contentTest = ` <li> <h3>Hello</h3> <pre class="brush: xml; title: ; notranslate" title=""> <html> <head> </head> <body> </body> </html> </pre> </li>` export default class SyntaxHighlighterTest extends React.Component{ render(){ return ( <View style={{ flex: 1, flexDirection: 'column' }}> <Html html={contentTest} renderers={{ pre: (node)=> { return <SyntaxHighlighter>{contentTest}</SyntaxHighlighter> } }} /> </View> ); } }
If I am using this content without <h3> tag then it is working fine:
<h3>
Working
const contentTest = ` <li> <pre class="brush: xml; title: ; notranslate" title=""> <html> <head> </head> <body> </body> </html> </pre> </li>`
Not Working
const contentTest = ` <li> <h3> Hello </h3> <pre class="brush: xml; title: ; notranslate" title=""> <html> <head> </head> <body> </body> </html> </pre> </li>`
SyntaxHighlighter
Note: It is working when I am using this outside of react-native-render-html, but I want to use within html renderer.
What will be the best practice to resolve this issue ?
Thank you
The text was updated successfully, but these errors were encountered:
does anyone have solution for this? still I am not able to do this.
Sorry, something went wrong.
I ran into this recently as well. I got around it by specifying Text for both PreTag and CodeTag properties. Like this:
Text
PreTag
CodeTag
<NativeSyntaxHighlighter language={language} PreTag={Text} CodeTag={Text}> {code} </NativeSyntaxHighlighter>
No branches or pull requests
Hello Conor,
I got an error while I am using
react-native-syntax-highlighter
insidereact-native-render-html
.I got this error:
Here is my code
I found that the content I am passing has an issue
If I am using this content without
<h3>
tag then it is working fine:Working
Not Working
So
SyntaxHighlighter
takes content that has only one child in parent tag.Note: It is working when I am using this outside of
react-native-render-html
, but I want to use within html renderer.What will be the best practice to resolve this issue ?
Thank you
The text was updated successfully, but these errors were encountered: