Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
markdown: Remove dead Twitter preview regex.
Aman Agrawalf68b24bd8ace
diff --git a/web/src/markdown.ts b/web/src/markdown.tsindex fa5dd91dc98..f893ec2e269 100644--- a/web/src/markdown.ts+++ b/web/src/markdown.ts@@ -28,9 +28,9 @@ const preview_regexes = [/\S*(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp|\.mp4|\.webm|\.aac|\.flac|\.mp3|\.mpeg|\.wav)\)?(\s+|$)/m,- // Twitter and youtube links are given previews+ // YouTube links are given previews- /\S*(?:twitter|youtube)\.com\/\S*/,+ /\S*youtube\.com\/\S*/,];function contains_preview_link(content: string): boolean {diff --git a/web/tests/markdown.test.cjs b/web/tests/markdown.test.cjsindex 3fd1ce95f22..a700fdcd369 100644--- a/web/tests/markdown.test.cjs+++ b/web/tests/markdown.test.cjs@@ -262,6 +262,10 @@ test("markdown_detection", () => {"User Mention @**leo with some name**","Group Mention @*hamletcharacters*","Stream #**Verona**",+ "Twitter URL https://twitter.com/jacobian/status/407886996565016579",+ "https://twitter.com/jacobian/status/407886996565016579",+ "then https://twitter.com/jacobian/status/407886996565016579",+ "Twitter URL http://twitter.com/jacobian/status/407886996565016579",];const markup = [@@ -272,10 +276,6 @@ test("markdown_detection", () => {"https://zulip.com/image.jpg too","Contains a zulip.com/foo.jpeg file","Contains a https://zulip.com/image.png file",- "Twitter URL https://twitter.com/jacobian/status/407886996565016579",- "https://twitter.com/jacobian/status/407886996565016579",- "then https://twitter.com/jacobian/status/407886996565016579",- "Twitter URL http://twitter.com/jacobian/status/407886996565016579","YouTube URL https://www.youtube.com/watch?v=HHZ8iqswiCw&feature=youtu.be&a",];