Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3247538
D5483.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
D5483.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5483: added tests to check spoiler regex extracted values
Attached
Detach File
Event Timeline
Log In to Comment