aboutsummaryrefslogtreecommitdiff
path: root/js/lib/inlines.js
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-11-10 10:52:11 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-11-10 10:52:11 -0800
commit4d4a3f72892ee50207e50e447a03f61e5c267867 (patch)
treefe88eabc8be7648cdb9f10709393417bd7335b33 /js/lib/inlines.js
parent65af8da7a80a9fb062cacf1ef7e21b0c91cfde53 (diff)
Allow images to contain images.
Diffstat (limited to 'js/lib/inlines.js')
-rw-r--r--js/lib/inlines.js26
1 files changed, 14 insertions, 12 deletions
diff --git a/js/lib/inlines.js b/js/lib/inlines.js
index cd60591..1f4d194 100644
--- a/js/lib/inlines.js
+++ b/js/lib/inlines.js
@@ -595,21 +595,23 @@ var parseCloseBracket = function(inlines) {
}
// processEmphasis will remove this and later delimiters.
- // Now we also remove earlier ones of the same kind (so,
- // no links in links, no images in images).
- opener = this.delimiters;
- closer_above = null;
- while (opener !== null) {
- if (opener.cc === (is_image ? C_BANG : C_OPEN_BRACKET)) {
- if (closer_above) {
- closer_above.previous = opener.previous;
- } else {
- this.delimiters = opener.previous;
- }
+ // Now, for a link, we also remove earlier link openers.
+ // (no links in links)
+ if (!is_image) {
+ opener = this.delimiters;
+ closer_above = null;
+ while (opener !== null) {
+ if (opener.cc === C_OPEN_BRACKET) {
+ if (closer_above) {
+ closer_above.previous = opener.previous;
+ } else {
+ this.delimiters = opener.previous;
+ }
} else {
- closer_above = opener;
+ closer_above = opener;
}
opener = opener.previous;
+ }
}
inlines.push({t: is_image ? 'Image' : 'Link',