diff --git a/native/markdown/rules.react.js b/native/markdown/rules.react.js --- a/native/markdown/rules.react.js +++ b/native/markdown/rules.react.js @@ -180,6 +180,26 @@ ), }, + spoiler: { + order: SimpleMarkdown.defaultRules.paragraph.order - 1, + match: SimpleMarkdown.inlineRegex(SharedMarkdown.spoilerRegex), + parse( + capture: SharedMarkdown.Capture, + parse: SharedMarkdown.Parser, + state: SharedMarkdown.State, + ) { + const content = capture[1]; + return { + content: SimpleMarkdown.parseInline(parse, content, state), + }; + }, + // eslint-disable-next-line react/display-name + react: ( + node: SharedMarkdown.SingleASTNode, + output: SharedMarkdown.Output, + state: SharedMarkdown.State, + ) => {output(node.content, state)}, + }, inlineCode: { ...SimpleMarkdown.defaultRules.inlineCode, // eslint-disable-next-line react/display-name