Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32145344
D5347.1765031648.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5347.1765031648.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
Sat, Dec 6, 2:34 PM (3 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5838614
Default Alt Text
D5347.1765031648.diff (1 KB)
Attached To
Mode
D5347: Add spoiler rule to native in fullMarkdownRules
Attached
Detach File
Event Timeline
Log In to Comment