@@ -1414,7 +1414,8 @@ def table_start_fn(ctx: "Wtp", token: str) -> None:
14141414
14151415# something=other, something="other", something = 'other'
14161416attr_assignment_pair = (
1417- r"""\s*[^"'>/=\0-\037\s]+""" r"""\s*=\s*("[^"]*"|'[^']*'|[^"'<>`\s]+)"""
1417+ r"""\s*[^"'>/=\0-\037\s]+"""
1418+ r"""\s*=\s*("[^"]*"|'[^']*'|[^"'<>`\s]+)"""
14181419)
14191420
14201421attr_assignments_re = re .compile (
@@ -1428,7 +1429,7 @@ def check_for_attributes(ctx: "Wtp", node: WikiNode) -> tuple[bool, str]:
14281429
14291430 # Old behavior added here to return earlier without needing
14301431 # to use regex matching; if the old version worked, why not?
1431- # If this fail , then resort to the reverse parsing + regex.
1432+ # If this fails , then resort to the reverse parsing + regex.
14321433 _parser_merge_str_children (ctx )
14331434 if len (node .children ) == 1 and isinstance (node .children [0 ], str ):
14341435 ret = node .children .pop ()
@@ -1623,7 +1624,10 @@ def table_cell_fn(ctx: "Wtp", token: str) -> None:
16231624 if len (node .children ) == 1 and isinstance (
16241625 attrs := node .children [0 ], str
16251626 ):
1626- node .children .pop ()
1627+ # At this point of parsing, we're just behind the start
1628+ # of one of the above node types; if they are followed
1629+ # by a `|`, that means the first child is an attr section
1630+ node .children .pop (0 )
16271631 # Using the walrus operator and pop()ing without return
16281632 # is just to make the type-checker happy without using
16291633 # an assert that attrs is definitely a str...
0 commit comments