markdown: Fix backend rendering regex.

An image link such as [example](http://www.example.com/example.png)
is supposed to be inlined by the backend.  The regex
backend_only_markdown_re in markdown.js does not recognize this link
as an image link, causing issues when adding fixtures to
zerver/fixtures/markdown_test_cases.json .
This commit is contained in:
Andy Perez 2017-12-27 13:46:57 -05:00 committed by showell
parent 1a83b32da5
commit 25b32a5ed7
1 changed files with 2 additions and 2 deletions

View File

@ -16,8 +16,8 @@ var backend_only_markdown_re = [
// Inline image previews, check for contiguous chars ending in image suffix
// To keep the below regexes simple, split them out for the end-of-message case
/[^\s]*(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp)\s+/m,
/[^\s]*(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp)$/m,
/[^\s]*(?:(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp)\)?)\s+/m,
/[^\s]*(?:(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp)\)?)$/m,
// Twitter and youtube links are given previews