summaryrefslogtreecommitdiff
path: root/src/inlines.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/inlines.c')
-rw-r--r--src/inlines.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/inlines.c b/src/inlines.c
index fdff57a..0dcfd72 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -607,9 +607,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);