The HTML attribute regex does not capture attributes that start with an @ correctly. You might run into this when working with shorthand event handlers in micro-frameworks such as Alpine.js or petite-vue. This fixes that.
e.g. @click="doSmt()" yields attribute click with a value of doSmt(). With the current regex, rawAttrs does not contain the right value (it contains click without the @). This PR fixes that.
The HTML attribute regex does not capture attributes that start with an
@
correctly. You might run into this when working with shorthand event handlers in micro-frameworks such as Alpine.js or petite-vue. This fixes that.e.g.
@click="doSmt()"
yields attributeclick
with a value ofdoSmt()
. With the current regex,rawAttrs
does not contain the right value (it containsclick
without the@
). This PR fixes that.https://github.com/taoqf/node-html-parser/blob/05f474f751a93ea30590733380263d2f669a3987/src/nodes/html.ts#L690