Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3385034
D5347.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5347.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 11:09 PM (21 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2598530
Default Alt Text
D5347.diff (1 KB)
Attached To
Mode
D5347: Add spoiler rule to native in fullMarkdownRules
Attached
Detach File
Event Timeline
Log In to Comment