Closed walsha2 closed 3 months ago
Description
Take the following, valid, Alpine.js use case:
Alpine.js
<div ... x-on:click.outside="open = false">Contents...</div>
This will throw a server error:
[SERVER] [ERROR] Invalid argument(s): "x-on:click.outside" is not a valid attribute name. [SERVER] [ERROR] package:jaspr/src/server/markup_render_object.dart 165:7 DomValidator.validateAttributeName
Doctor Output
Using the latest main branch revisions of all jaspr apps.
main
jaspr
Discussion
packages/jaspr/lib/src/server/markup_render_object.dart
The following modification should resolve the issue:
static final _attributeRegExp = RegExp(r'^[a-z](?:[a-zA-Z0-9\-_:.]*[a-z0-9]+)?$');
This modification allows for . to appear anywhere in the string along with the other special characters.
.
With this change, the following string is now valid: x-on:click.outside
x-on:click.outside
Description
Take the following, valid,
Alpine.js
use case:This will throw a server error:
Doctor Output
Using the latest
main
branch revisions of alljaspr
apps.Discussion
The following modification should resolve the issue:
This modification allows for
.
to appear anywhere in the string along with the other special characters.With this change, the following string is now valid:
x-on:click.outside