Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Commit

Permalink
Fix of a bug in shortcut reference at the end of the document
Browse files Browse the repository at this point in the history
  • Loading branch information
Natacha Porté committed Oct 22, 2009
1 parent db16ee8 commit 7f90762
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions markdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,9 @@ char_link(struct buf *ob, struct render *rndr,
while (i < size
&& (data[i] == ' ' || data[i] == '\t' || data[i] == '\n'))
i += 1;
if (i >= size) return 0;

/* inline style link */
if (data[i] == '(') {
if (i < size && data[i] == '(') {
/* skipping initial whitespace */
i += 1;
while (i < size && (data[i] == ' ' || data[i] == '\t')) i += 1;
Expand Down Expand Up @@ -851,7 +850,7 @@ char_link(struct buf *ob, struct render *rndr,
i += 1; }

/* reference style link */
else if (data[i] == '[') {
else if (i < size && data[i] == '[') {
struct buf id = { 0, 0, 0, 0, 0 };
struct link_ref *lr;

Expand Down

0 comments on commit 7f90762

Please sign in to comment.