Page MenuHomePhabricator

D5347.id17497.diff
No OneTemporary

D5347.id17497.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
@@ -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

Mime Type
text/plain
Expires
Sat, Nov 30, 1:24 AM (21 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2598943
Default Alt Text
D5347.id17497.diff (1 KB)

Event Timeline