diff --git a/inline.go b/inline.go index 4483b8f..27056eb 100644 --- a/inline.go +++ b/inline.go @@ -252,7 +252,7 @@ func link(p *parser, out *bytes.Buffer, data []byte, offset int) int { case data[i] == '\n': textHasNl = true - case data[i-1] == '\\': + case isBackslashEscaped(data, i): continue case data[i] == '[': diff --git a/testdata/Links, inline style.html b/testdata/Links, inline style.html index 5802f2d..d0ea472 100644 --- a/testdata/Links, inline style.html +++ b/testdata/Links, inline style.html @@ -8,4 +8,6 @@

URL and title.

+

URL with backslashes\.

+

[Empty]().

diff --git a/testdata/Links, inline style.text b/testdata/Links, inline style.text index 09017a9..dfa328d 100644 --- a/testdata/Links, inline style.text +++ b/testdata/Links, inline style.text @@ -8,5 +8,6 @@ Just a [URL](/url/). [URL and title](/url/ "title has spaces afterward" ). +[URL with backslashes\\](/url/). [Empty]().