Fixes bug in potentially cyclic ligatures

* fixes issue #133
pull/134/head
John Mager 2020-06-21 03:31:23 +00:00
parent bb0e4dc3af
commit 2508b90ce9
1 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,12 @@ def rule(liga):
ignore(head=liga[0], suffix=(liga[1:] + [liga[-1]])),
]
# careful with repeats:
# #133 ->->->->, /**/**/**/, etc.
if len(liga) > 2 and liga[0] == liga[-1]:
rules.append(ignore([liga[-2]], liga[0], liga[1:]))
rules.append(ignore(head=liga[0], suffix=(liga[1:] + [liga[1]])))
# hardcoded ignores, i.e. `<||>`
rules.extend(ignores[tuple(liga)])