Merge pull request #208 from russross/issue-18

Fix escaping asterisks within emphasis
pull/212/head
Vytautas Šaltenis 2015-10-19 09:05:52 +03:00
commit 82a3b62629
2 changed files with 6 additions and 4 deletions

View File

@ -919,15 +919,14 @@ func helperFindEmphChar(data []byte, c byte) int {
if i >= len(data) {
return 0
}
if data[i] == c {
return i
}
// do not count escaped chars
if i != 0 && data[i-1] == '\\' {
i++
continue
}
if data[i] == c {
return i
}
if data[i] == '`' {
// skip a code span

View File

@ -153,6 +153,9 @@ func TestEmphasis(t *testing.T) {
"mix of *markers_\n",
"<p>mix of *markers_</p>\n",
"*What is A\\* algorithm?*\n",
"<p><em>What is A* algorithm?</em></p>\n",
}
doTestsInline(t, tests)
}