Page MenuHomePhabricator

D5546.id18159.diff
No OneTemporary

D5546.id18159.diff

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<SharedMarkdown.ReactElement>,
+ state: SharedMarkdown.State,
+ ) => <span>{output(node.content, state)}</span>,
+ },
inlineCode: SimpleMarkdown.defaultRules.inlineCode,
em: SimpleMarkdown.defaultRules.em,
strong: SimpleMarkdown.defaultRules.strong,

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 1:26 PM (19 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2593909
Default Alt Text
D5546.id18159.diff (1 KB)

Event Timeline