Changeset View
Changeset View
Standalone View
Standalone View
native/markdown/rules.react.js
Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | blockQuote: { | ||||
SharedMarkdown.blockQuoteStripFollowingNewlineRegex, | SharedMarkdown.blockQuoteStripFollowingNewlineRegex, | ||||
), | ), | ||||
parse: SharedMarkdown.parseBlockQuote, | parse: SharedMarkdown.parseBlockQuote, | ||||
// eslint-disable-next-line react/display-name | // eslint-disable-next-line react/display-name | ||||
react: ( | react: ( | ||||
node: SharedMarkdown.SingleASTNode, | node: SharedMarkdown.SingleASTNode, | ||||
output: SharedMarkdown.Output<SharedMarkdown.ReactElement>, | output: SharedMarkdown.Output<SharedMarkdown.ReactElement>, | ||||
state: SharedMarkdown.State, | state: SharedMarkdown.State, | ||||
) => ( | ) => { | ||||
<View key={state.key} style={styles.blockQuote}> | const { isNestedQuote } = state; | ||||
{output(node.content, state)} | const backgroundColor = isNestedQuote ? '#00000000' : '#00000066'; | ||||
return ( | |||||
<View | |||||
key={state.key} | |||||
style={[styles.blockQuote, { backgroundColor }]} | |||||
> | |||||
{output(node.content, { ...state, isNestedQuote: true })} | |||||
</View> | </View> | ||||
), | ); | ||||
}, | |||||
}, | }, | ||||
codeBlock: { | codeBlock: { | ||||
...SimpleMarkdown.defaultRules.codeBlock, | ...SimpleMarkdown.defaultRules.codeBlock, | ||||
match: SimpleMarkdown.blockRegex( | match: SimpleMarkdown.blockRegex( | ||||
SharedMarkdown.codeBlockStripTrailingNewlineRegex, | SharedMarkdown.codeBlockStripTrailingNewlineRegex, | ||||
), | ), | ||||
parse(capture: SharedMarkdown.Capture) { | parse(capture: SharedMarkdown.Capture) { | ||||
return { | return { | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |