Skip to content

Commit

Permalink
Fixes #104 : Invalid precending character breaks emphasis
Browse files Browse the repository at this point in the history
  • Loading branch information
yuin committed Mar 1, 2020
1 parent a727b5a commit 2143794
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion text/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ func (r *blockReader) PrecendingCharacter() rune {
if r.pos.Padding != 0 {
return rune(' ')
}
if r.pos.Start <= 0 {
if r.segments.Len() < 1 {
return rune('\n')
}
firstSegment := r.segments.At(0)
if r.line == 0 && r.pos.Start <= firstSegment.Start {
return rune('\n')
}
l := len(r.source)
Expand Down

0 comments on commit 2143794

Please sign in to comment.