Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3362477
D5347.id17497.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.id17497.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
@@ -180,6 +180,21 @@
</Text>
),
},
+ spoiler: {
+ order: SimpleMarkdown.defaultRules.paragraph.order - 1,
+ match: SharedMarkdown.matchSpoiler(),
+ parse: SharedMarkdown.parseSpoiler,
+ // eslint-disable-next-line react/display-name
+ react: (
+ node: SharedMarkdown.SingleASTNode,
+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,
+ state: SharedMarkdown.State,
+ ) => (
+ <Text key={state.key} style={styles.spoiler}>
+ {output(node.content, state)}
+ </Text>
+ ),
+ },
inlineCode: {
...SimpleMarkdown.defaultRules.inlineCode,
// eslint-disable-next-line react/display-name
diff --git a/native/markdown/styles.js b/native/markdown/styles.js
--- a/native/markdown/styles.js
+++ b/native/markdown/styles.js
@@ -11,6 +11,11 @@
color: 'markdownLink',
textDecorationLine: 'underline',
},
+ spoiler: {
+ // Placeholder, in order to check that the spoiler is rendered correctly.
+ // ENG-1983 will add the actual styling for spoiler text
+ color: 'red',
+ },
italics: {
fontStyle: 'italic',
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 10:56 PM (14 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579752
Default Alt Text
D5347.id17497.diff (1 KB)
Attached To
Mode
D5347: Add spoiler rule to native in fullMarkdownRules
Attached
Detach File
Event Timeline
Log In to Comment