Skip to content

Commit

Permalink
allow commas in unquoted prop strings (#3130)
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler authored May 28, 2024
1 parent d824acb commit 7a3cfc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nicegui/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
' # Match the closing quote
)
| # Or
([\w\-.%:\/]+) # Capture group 4: Value without quotes
([\w\-.,%:\/]+) # Capture group 4: Value without quotes
)
)? # End of optional non-capturing group for value
(?:$|\s) # Match end of string or whitespace
Expand Down
1 change: 1 addition & 0 deletions tests/test_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def test_props_parsing():
assert ui.element._parse_props('href=http://192.168.42.100/') == {'href': 'http://192.168.42.100/'}
assert ui.element._parse_props('hint="Your \\"given\\" name"') == {'hint': 'Your "given" name'}
assert ui.element._parse_props('input-style="{ color: #ff0000 }"') == {'input-style': '{ color: #ff0000 }'}
assert ui.element._parse_props('accept=.jpeg,.jpg,.png') == {'accept': '.jpeg,.jpg,.png'}

assert ui.element._parse_props('empty=""') == {'empty': ''}
assert ui.element._parse_props("empty=''") == {'empty': ''}
Expand Down

0 comments on commit 7a3cfc2

Please sign in to comment.