diff --git a/web/markdown/rules.react.js b/web/markdown/rules.react.js --- a/web/markdown/rules.react.js +++ b/web/markdown/rules.react.js @@ -81,6 +81,26 @@ match: SharedMarkdown.matchBlockQuote(SharedMarkdown.blockQuoteRegex), parse: SharedMarkdown.parseBlockQuote, }, + 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, em: SimpleMarkdown.defaultRules.em, strong: SimpleMarkdown.defaultRules.strong,