Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions wikitextparser/_spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@
# https://www.w3.org/TR/html5/syntax.html#syntax-attributes
ATTR_NAME = rb'(?<attr_name>[^' + SPACE_CHARS + CONTROL_CHARS + rb'"\'>/=]++)'
EQ_WS = rb'[=\1][' + SPACE_CHARS + rb']*+'
UNQUOTED_ATTR_VAL = rb'(?<attr_value>[^' + SPACE_CHARS + rb'"\'=<>`]++)'
QUOTED_ATTR_VAL = rb'(?<quote>[\'"])(?<attr_value>.*?)(?P=quote)'
UNQUOTED_ATTR_VAL = rb'[\'"]?(?<attr_value>[^' + SPACE_CHARS + rb'"\'=<>`/]++)'
QUOTED_ATTR_VAL = rb'(?<quote>[\'"])(?<attr_value>[^"\'<>]*?)(?P=quote)'
# May include character references, but for now, ignore the fact that they
# cannot contain an ambiguous ampersand.
ATTR_VAL = (
Expand All @@ -164,9 +164,9 @@
+ rb']*+'
+ EQ_WS
+ rb'(?>'
+ UNQUOTED_ATTR_VAL
+ rb'|'
+ QUOTED_ATTR_VAL
+ rb'|'
+ UNQUOTED_ATTR_VAL
+ rb')'
+ rb'|(?<attr_value>)' # empty attribute
+ rb')'
Expand Down