whatwg / urlpattern

URL Pattern Standard
https://urlpattern.spec.whatwg.org/
Other
159 stars 22 forks source link

Emit `{}` when plain text follows a `:foo` group. (#145) #154

Closed wanderview closed 2 years ago

wanderview commented 2 years ago

This fixes another issue highlighted in #145.

In this case we need to detect when fixed text following a :foo group could be mistaken as part of the name. When this happens we should emit { } braces around the group to isolate it. For example, {:foo}bar instead of of :foobar.

This spec change corresponds to the following implementation changes:

https://chromium-review.googlesource.com/c/chromium/src/+/3321520 https://chromium-review.googlesource.com/c/chromium/src/+/3328146


Preview | Diff

wanderview commented 2 years ago

@domenic PTAL. Its a bit of an awkward structure, but I think this might be clearer than repeating some of the logic conditionals.