0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-15 03:01:37 -05:00

Updated Ghostdown image regex

Updated dropzone regex to capture existing URL flag. Also supports the shorter markdown image syntax, and corrects issues with special characters in the alt field, fixing issue .
This commit is contained in:
Christopher Giffard 2013-07-29 13:22:25 +10:00
parent 26028a111b
commit 333a9288a1

View file

@ -5,7 +5,7 @@
{
type: 'lang',
filter: function (source) {
return source.replace(/\n?!image\[([\d\w\s]*)\]/gi, function (match, alt, a) {
return source.replace(/\n?!(?:image)?\[([^\n\]]*)\](?:\(([^\n\)]*)\))?/gi, function (match, alt, a) {
return '<section class="js-drop-zone image-uploader">' +
'<span class="media"><span class="hidden">Image Upload</span></span>' +
'<div class="description">Add image of <strong>' + alt + '</strong></div>' +