diff --git a/dist/showdown.js b/dist/showdown.js index 30e0848..ad78964 100644 Binary files a/dist/showdown.js and b/dist/showdown.js differ diff --git a/dist/showdown.js.map b/dist/showdown.js.map index 58ad640..24c2367 100644 Binary files a/dist/showdown.js.map and b/dist/showdown.js.map differ diff --git a/dist/showdown.min.js b/dist/showdown.min.js index 4e7f4f5..f1b60f5 100644 Binary files a/dist/showdown.min.js and b/dist/showdown.min.js differ diff --git a/dist/showdown.min.js.map b/dist/showdown.min.js.map index d11b4ee..7a6c71b 100644 Binary files a/dist/showdown.min.js.map and b/dist/showdown.min.js.map differ diff --git a/src/subParsers/images.js b/src/subParsers/images.js index d5491a3..46cf275 100644 --- a/src/subParsers/images.js +++ b/src/subParsers/images.js @@ -7,7 +7,7 @@ showdown.subParser('images', function (text, options, globals) { text = globals.converter._dispatch('images.before', text, options, globals); var inlineRegExp = /!\[(.*?)]\s?\([ \t]*()?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(['"])(.*?)\6[ \t]*)?\)/g, - referenceRegExp = /!\[(.*?)][ ]?(?:\n[ ]*)?\[(.*?)]()()()()()/g; + referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[(.*?)]()()()()()/g; function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) { diff --git a/test/issues/#261.mix-images-with-links.html b/test/issues/#261.mix-images-with-links.html new file mode 100644 index 0000000..52617da --- /dev/null +++ b/test/issues/#261.mix-images-with-links.html @@ -0,0 +1,17 @@ +

sd-inline sd-ref

+ +

foo

+ +

sd-inline sd-ref

+ +

foo

+ +

sd-ref sd-inline

+ +

foo

+ +

sd-ref sd-inline

+ +

foo

+ +

sd-ref

diff --git a/test/issues/#261.mix-images-with-links.md b/test/issues/#261.mix-images-with-links.md new file mode 100644 index 0000000..36ce785 --- /dev/null +++ b/test/issues/#261.mix-images-with-links.md @@ -0,0 +1,19 @@ +![sd-inline](https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png) [sd-ref][sd-logo] + +foo + +[sd-inline](https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png) ![sd-ref][sd-logo] + +foo + +![sd-ref][sd-logo] [sd-inline](https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png) + +foo + +[sd-ref][sd-logo] ![sd-inline](https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png) + +foo + +[![sd-ref][sd-logo]](http://www.google.com/) + +[sd-logo]: https://www.google.pt/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png \ No newline at end of file diff --git a/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.html b/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.html new file mode 100644 index 0000000..11a7a74 --- /dev/null +++ b/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.html @@ -0,0 +1,5 @@ +

sd-inline sd-ref

+ +

foo

+ +

sd-ref sd-inline

diff --git a/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.md b/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.md new file mode 100644 index 0000000..0e76cbb --- /dev/null +++ b/test/issues/#261.reference-style-image-after-inline-style-image-does-not-work-correctely.md @@ -0,0 +1,7 @@ +![sd-inline](https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png) ![sd-ref][sd-logo] + +foo + +![sd-ref][sd-logo] ![sd-inline](https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png) + +[sd-logo]: https://www.google.pt/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png diff --git a/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.html b/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.html new file mode 100644 index 0000000..eda7d4b --- /dev/null +++ b/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.html @@ -0,0 +1,5 @@ +

sd-inline sd-ref

+ +

foo

+ +

sd-ref sd-inline

diff --git a/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.md b/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.md new file mode 100644 index 0000000..40b7f8f --- /dev/null +++ b/test/issues/#261.reference-style-link-after-inline-style-link-does-not-work-correctely.md @@ -0,0 +1,7 @@ +[sd-inline](https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png) [sd-ref][sd-logo] + +foo + +[sd-ref][sd-logo] [sd-inline](https://raw.githubusercontent.com/showdownjs/logo/master/dist/logo.readme.png) + +[sd-logo]: https://www.google.pt/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png