reactive-python / reactpy-django

It's React, but in Python. Now with Django integration.
https://reactive-python.github.io/reactpy-django/
MIT License
328 stars 18 forks source link

Allow whitespace characters within component regex #96

Closed Archmonger closed 2 years ago

Archmonger commented 2 years ago

Description

I realized some handlebars formatters will add indentation and newlines. Therefore, I've made the component regex a bit more robust to handle those situations.

Checklist:

Please update this checklist as you complete each item:

rmorshea commented 2 years ago

In usages of the regex pattern you can use pattern.match(...).group(group_name) instead of grabbing them by index.

Archmonger commented 2 years ago

I believe pattern.match(...).group(group_name) only works with single objects. To "find all" I needed to use finditer and groupdict.

I don't believe I'm using the index anywhere anymore.