Skip to content

Commit

Permalink
Merge pull request #9 from gmsgowtham/feat/support/html-type
Browse files Browse the repository at this point in the history
feat: render html content as it is
  • Loading branch information
gmsgowtham authored Sep 10, 2022
2 parents 6665f31 + 8c8390a commit b1eca4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/react-native-marked-sample/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function App() {
return (
<SafeAreaView>
<Markdown
value={json.body_markdown_4}
value={json.body_markdown_1}
flatListProps={{
contentContainerStyle: styles.container,
}}
Expand Down
7 changes: 3 additions & 4 deletions src/lib/Parser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ class Parser {
this.styles.li
);
}
case 'html': {
return this.renderer.getTextNode(token.text.trim(), this.styles.text);
}
default:
console.warn(`Token with '${token.type}' type was not found.`);
return null;
Expand All @@ -118,10 +121,6 @@ class Parser {
...this.styles.text,
});
}
case 'html': {
console.log('html', token);
return null;
}
case 'link': {
return this.renderer.getLinkNode(token.text, token.href, {
...styles,
Expand Down

0 comments on commit b1eca4e

Please sign in to comment.