Closed y-maslouskaya closed 8 months ago
Same here
This is the original rule for text:
text: (node, children, parent, styles, inheritedStyles = {}) => ( <Text key={node.key} style={[inheritedStyles, styles.text]}> {node.content} </Text> ),
As you can see, it uses node.content
Please use it to get the text
Anyone have an actual example of how to implement this?
import Markdown from 'react-native-markdown-display'
<Markdown style={{ body: { userSelect: 'auto' } }} />
This sort of straightforward/basic approach is not working.
const rules = { textgroup: (node, children, parent, myStyles, inheritedStyles = {}) => { return ( <Text key={node.key} style={[inheritedStyles, styles.textMarkdown]} selectable={true} selectionColor={CONSTANT.SECONDARY_LIGHT_GREY}> {children} </Text> ); }, };
Apply this rule you will be able to select all text.
I am trying to allow to select and paste text. I found a related question under the issue #126, so I decided to try rules to change component to and apply selectable={true}. But for some reason the text disappeared (only numbers were left) in my component after I had added rules. Did I write rules incorrectly? Thank you in advance!
ordered_list: (node, children, parent, styles) => ( <Text key={node.key} style={styles.ordered_list} selectable={true}> {children} </Text> ),