summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-01-03 23:16:39 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-03 23:16:39 -0800
commit04539263eaeb06629a49fc5d531166e84162dd84 (patch)
tree66009aa85cb3c71cf0ded91a85e369f8f4420dc3 /src
parent39c69d0529a8578e3f30e4409d7e571a7730f3f3 (diff)
Slight improvement of clarity of logic in emph matching.
Diffstat (limited to 'src')
-rw-r--r--src/inlines.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 014ab1e..6a27aea 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -538,15 +538,16 @@ static void process_emphasis(subject *subj, delimiter *stack_bottom) {
odd_match = false;
while (opener != NULL && opener != stack_bottom &&
opener != openers_bottom[closer->delim_char]) {
- // interior closer of size 2 can't match opener of size 1
- // or of size 1 can't match 2
- odd_match = (closer->can_open || opener->can_close) &&
- ((opener->length + closer->length) % 3 == 0);
- if (opener->delim_char == closer->delim_char && opener->can_open &&
- !odd_match) {
- opener_found = true;
- break;
- }
+ if (opener->can_open && opener->delim_char == closer->delim_char) {
+ // interior closer of size 2 can't match opener of size 1
+ // or of size 1 can't match 2
+ odd_match = (closer->can_open || opener->can_close) &&
+ ((opener->length + closer->length) % 3 == 0);
+ if (!odd_match) {
+ opener_found = true;
+ break;
+ }
+ }
opener = opener->previous;
}
old_closer = closer;