From 030392d2cff4f186705559eecf96394d35617659 Mon Sep 17 00:00:00 2001 From: David Szotten Date: Sat, 19 Sep 2015 15:12:08 +0100 Subject: [PATCH] only remove enclosing angle brackets --- src/document.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/document.c b/src/document.c index e2731dab..ee0102f1 100644 --- a/src/document.c +++ b/src/document.c @@ -1199,8 +1199,10 @@ char_link(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t offse link_e--; /* remove optional angle brackets around the link */ - if (data[link_b] == '<') link_b++; - if (data[link_e - 1] == '>') link_e--; + if (data[link_b] == '<' && data[link_e - 1] == '>') { + link_b++; + link_e--; + } /* building escaped link and title */ if (link_e > link_b) {