0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -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 #146.
This commit is contained in:
Christopher Giffard 2013-07-29 13:22:25 +10:00
parent 68cc640d23
commit 09ada68d9b

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>' +