diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inlines.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/inlines.c b/src/inlines.c index e08b757..2d26e81 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -617,9 +617,15 @@ static int link_label(subject* subj, chunk *raw_label) { int startpos = subj->pos; int length = 0; - - advance(subj); // advance past [ unsigned char c; + + // advance past [ + if (peek_char(subj) == '[') { + advance(subj); + } else { + return 0; + } + while ((c = peek_char(subj)) && c != '[' && c != ']') { if (c == '\\') { advance(subj); |