Skip to content
Snippets Groups Projects
Commit 7bb1968b authored by George Secrieru's avatar George Secrieru
Browse files

Fixing Markdown regex for image support

parent 5329b815
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ class Markdown
msg = message.html
# Support ![alt text](http://image url)
msg = msg.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/gm, '<a href="$2" title="$1" class="swipebox" target="_blank"><div class="inline-image" style="background-image: url($2);"></div></a>')
msg = msg.replace(/!\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/gm, '<a href="$2" title="$1" class="swipebox" target="_blank"><div class="inline-image" style="background-image: url($2);"></div></a>')
# Support [Text](http://link)
msg = msg.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/gm, '<a href="$2" target="_blank">$1</a>')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment