Open diegolmello opened 6 years ago
Custom rules allow to send components to react-native-easy-markdown. A Twitter's username rule could be created like this:
<Markdown rules={{ username: { order: 1, match: SimpleMarkdown.inlineRegex(/@[0-9a-zA-Z-_.]+/), parse: capture => ({ content: capture[0] }), react: (node, output, state) => ({ type: 'custom', key: state.key, props: { children: ( <Text key={state.key} style={{ color: 'blue', fontWeight: 'bold' }} onPress={() => alert('Works')} > {node.content} </Text> ) } }) } }}>
Custom rules allow to send components to react-native-easy-markdown. A Twitter's username rule could be created like this: