Page MenuHomePhabricator

D5347.id17523.diff
No OneTemporary

D5347.id17523.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
Mon, Nov 25, 12:37 PM (3 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579752
Default Alt Text
D5347.id17523.diff (1 KB)

Event Timeline