Fix argument_call_classes breaking on "==".
This commit is contained in:
parent
89dcb5ee0e
commit
ada3fc4caa
1 changed files with 3 additions and 1 deletions
|
@ -498,6 +498,7 @@ def fix_argument_call_classes(element):
|
||||||
'''
|
'''
|
||||||
# print('INPUT', repr(element))
|
# print('INPUT', repr(element))
|
||||||
paren_depth = 0
|
paren_depth = 0
|
||||||
|
last_known_candidate = None
|
||||||
while True:
|
while True:
|
||||||
element = next_element_sibling(element)
|
element = next_element_sibling(element)
|
||||||
# print(element, paren_depth)
|
# print(element, paren_depth)
|
||||||
|
@ -512,9 +513,10 @@ def fix_argument_call_classes(element):
|
||||||
if 'n' in element['class']:
|
if 'n' in element['class']:
|
||||||
last_known_candidate = element
|
last_known_candidate = element
|
||||||
|
|
||||||
if 'o' in element['class'] and innertext == '=':
|
if last_known_candidate and 'o' in element['class'] and innertext == '=':
|
||||||
last_known_candidate['class'].remove('n')
|
last_known_candidate['class'].remove('n')
|
||||||
last_known_candidate['class'].append('narg')
|
last_known_candidate['class'].append('narg')
|
||||||
|
last_known_candidate = None
|
||||||
|
|
||||||
if paren_depth == 0:
|
if paren_depth == 0:
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue