Merge pull request #208 from russross/issue-18
Fix escaping asterisks within emphasis
This commit is contained in:
commit
82a3b62629
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue