From f953e0ea24f530650784f73d87cca1a2ea8baff1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 29 Jun 2017 14:55:14 +0200 Subject: DeMorgan simplification of some tests in emphasis parser. This also brings the code into closer alignment with the wording of the spec. See jgm/CommonMark#467. --- src/inlines.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/inlines.c') diff --git a/src/inlines.c b/src/inlines.c index eea0631..f5b0621 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -331,13 +331,13 @@ static int scan_delims(subject *subj, unsigned char c, bool *can_open, after_char = 10; } left_flanking = numdelims > 0 && !cmark_utf8proc_is_space(after_char) && - !(cmark_utf8proc_is_punctuation(after_char) && - !cmark_utf8proc_is_space(before_char) && - !cmark_utf8proc_is_punctuation(before_char)); + (!cmark_utf8proc_is_punctuation(after_char) || + cmark_utf8proc_is_space(before_char) || + cmark_utf8proc_is_punctuation(before_char)); right_flanking = numdelims > 0 && !cmark_utf8proc_is_space(before_char) && - !(cmark_utf8proc_is_punctuation(before_char) && - !cmark_utf8proc_is_space(after_char) && - !cmark_utf8proc_is_punctuation(after_char)); + (!cmark_utf8proc_is_punctuation(before_char) || + cmark_utf8proc_is_space(after_char) || + cmark_utf8proc_is_punctuation(after_char)); if (c == '_') { *can_open = left_flanking && (!right_flanking || cmark_utf8proc_is_punctuation(before_char)); -- cgit v1.2.3