Skip to content

Commit

Permalink
Fixed _ emphasis parsing to conform to spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Apr 28, 2015
1 parent 24aacaf commit b2c3cef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/inlines.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ scan_delims(subject* subj, unsigned char c, bool * can_open, bool * can_close)
!utf8proc_is_space(after_char) &&
!utf8proc_is_punctuation(after_char));
if (c == '_') {
*can_open = left_flanking && !right_flanking;
*can_close = right_flanking && !left_flanking;
*can_open = left_flanking &&
(!right_flanking || utf8proc_is_punctuation(before_char));
*can_close = right_flanking &&
(!left_flanking || utf8proc_is_punctuation(after_char));
} else if (c == '\'' || c == '"') {
*can_open = left_flanking && !right_flanking;
*can_close = right_flanking;
Expand Down

0 comments on commit b2c3cef

Please sign in to comment.