diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-12-26 12:30:15 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-12-26 12:30:15 -0700 |
commit | a1eff0bc5359d4defaf3f0e96742daaf36985f08 (patch) | |
tree | 26ed2fc1e8fb4563853d3ba5ede4c25635d5fd41 /src | |
parent | a0f6493dda58a0ab905a80c73c19b1d76ff0c977 (diff) |
Optimized the change in 72a556fd3bd17feaffba2fb6faa8c8f2a3931643.
Thanks @Knagis.
Diffstat (limited to 'src')
-rw-r--r-- | src/inlines.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/inlines.c b/src/inlines.c index 83545f4..8235f59 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -682,7 +682,6 @@ static cmark_node* handle_close_bracket(subject* subj, cmark_node *parent) cmark_chunk urlcmark_chunk, titlecmark_chunk; unsigned char *url, *title; delimiter *opener; - delimiter *tmp_delim; cmark_node *link_text; cmark_node *inl; cmark_chunk raw_label; @@ -809,11 +808,14 @@ match: if (!is_image) { opener = subj->last_delim; while (opener != NULL) { - tmp_delim = opener->previous; if (opener->delim_char == '[') { - opener->active = false; + if (!opener->active) { + break; + } else { + opener->active = false; + } } - opener = tmp_delim; + opener = opener->previous; } } |