1
0
mirror of https://github.com/danog/blackfriday.git synced 2024-11-27 04:24:41 +01:00

Merge pull request #224 from russross/issue-180

Fix for #180
This commit is contained in:
Vytautas Šaltenis 2015-12-11 20:25:12 +02:00
commit 3c4a488ada
3 changed files with 5 additions and 6 deletions

View File

@ -275,8 +275,8 @@ func link(p *parser, out *bytes.Buffer, data []byte, offset int) int {
i++
}
// inline style link
switch {
// inline style link
case i < len(data) && data[i] == '(':
// skip initial whitespace
i++

View File

@ -15,9 +15,8 @@ package blackfriday
import (
"regexp"
"testing"
"strings"
"testing"
)
func runMarkdownInline(input string, opts Options, htmlFlags int, params HtmlRendererParameters) string {
@ -695,6 +694,9 @@ func TestReferenceLink(t *testing.T) {
"[ref]\n [ref]: ../url/ \"title\"\n",
"<p><a href=\"../url/\" title=\"title\">ref</a></p>\n",
"[link][ref]\n [ref]: /url/",
"<p><a href=\"/url/\">link</a></p>\n",
}
doLinkTestsInline(t, tests)
}

View File

@ -638,9 +638,6 @@ func scanLinkRef(p *parser, data []byte, i int) (linkOffset, linkEnd, titleOffse
for i < len(data) && data[i] != ' ' && data[i] != '\t' && data[i] != '\n' && data[i] != '\r' {
i++
}
if i == len(data) {
return
}
linkEnd = i
if data[linkOffset] == '<' && data[linkEnd-1] == '>' {
linkOffset++