Page MenuHomePhabricator

D5483.diff
No OneTemporary

D5483.diff

diff --git a/lib/shared/markdown.test.js b/lib/shared/markdown.test.js
--- a/lib/shared/markdown.test.js
+++ b/lib/shared/markdown.test.js
@@ -51,4 +51,34 @@
expect('|| \n\
||').not.toMatch(spoilerRegex);
});
+
+ it("We expect to extract 'hello' from the following spoiler: ||hello||", () => {
+ const spoiler = '||hello||';
+ const extracted = spoiler.match(spoilerRegex);
+ expect(extracted ? extracted[0] : null).toMatch('hello');
+ });
+
+ it("We expect to extract '||' from the following spoiler: ||||||", () => {
+ const spoiler = '||||||';
+ const extracted = spoiler.match(spoilerRegex);
+ expect(extracted ? extracted[0] : null).toMatch('||');
+ });
+
+ it("We expect to extract ' ' from the following spoiler: || || ||", () => {
+ const spoiler = '|| || ||';
+ const extracted = spoiler.match(spoilerRegex);
+ expect(extracted ? extracted[0] : null).toMatch(' ');
+ });
+
+ it("We expect to extract '||THISISASPOILER||' from the following spoiler: ||||THISISASPOILER||||", () => {
+ const spoiler = '||||THISISASPOILER||||';
+ const extracted = spoiler.match(spoilerRegex);
+ expect(extracted ? extracted[0] : null).toMatch('||THISISASPOILER||');
+ });
+
+ it("We expect to extract '' from the following spoiler: || \\|\\| ||", () => {
+ const spoiler = '|| \\|\\| ||';
+ const extracted = spoiler.match(spoilerRegex);
+ expect(extracted ? extracted[0] : null).toMatch(' \\|\\| ');
+ });
});

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 5:51 AM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2496569
Default Alt Text
D5483.diff (1 KB)

Event Timeline