Open jakthegr8 opened 3 years ago
I too have the same issue, switched to webview.
The children components will respect the parent accessibility role. Which in this case will always be Text.
What you can do is to set the parent component to not have any accessibility role, so that the children components can have their own accessibility props.
In the rules props function, just return the textgroup as react fragment
const rules = (props: Props): RenderRules => {
return {
textgroup: (children) => <>{children}</>,
link: (node, __, ___, ____) => {
const { content } = node.children[0];
return (
<Text key={node.key} accessibilityRole="link" onPress={() => onPress()}>
{content}
</Text>
);
},
}
<MarkdownRenderer style={mergedMarkdownStyle} rules={rules(this.props)}>
{children}
</MarkdownRenderer
I've wrap the
The markdown is not supporting accessibility(https://reactnative.dev/docs/accessibility) tags. Basically I want to add focus
(accessible={true})
for link elements inside the markdown tag, But there is no way to do it.