mientjan / react-native-markdown-renderer

React Native 100% compatible CommonMark renderer
MIT License
424 stars 418 forks source link

markdown-it-checkbox Integration #97

Open AugustoAleGon opened 5 years ago

AugustoAleGon commented 5 years ago

I am trying to use this plugin: https://github.com/mcecot/markdown-it-checkbox for the a checkbox in the messages. Somebody can give me some help. After I have installed the plugin and then declared the new markdown. How can I make it work?

asurare commented 4 years ago

Just like that :

import Markdown from "react-native-markdown-renderer"
import markdownItCheckbox from "markdown-it-checkbox"

import MarkdownIt from "markdown-it"

const md = MarkdownIt().use(markdownItCheckbox)

const App = () => (
  <View style={styles.container}>
    <Markdown markdownit={md}>
      {copy}
    </Markdown>
  </View>
)

export default App