Page MenuHomePhabricator

D5347.id19044.diff
No OneTemporary

D5347.id19044.diff

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
@@ -181,6 +181,26 @@
</Text>
),
},
+ 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,
+ ) => <Text key={state.key}>{output(node.content, state)}</Text>,
+ },
inlineCode: {
...SimpleMarkdown.defaultRules.inlineCode,
// eslint-disable-next-line react/display-name

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 12:37 PM (3 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579751
Default Alt Text
D5347.id19044.diff (1 KB)

Event Timeline