Skip to content

Commit

Permalink
Fixed parsing attributes with the _ character in the HTMLParser.
Browse files Browse the repository at this point in the history
  • Loading branch information
petersirka committed Sep 10, 2024
1 parent 8b88565 commit b3330c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- added `@{hostname([url])}`
- added `controller.href()` method
- extended `HTMLParser` by adding selector for prefixes, example: `node.find('xsd:')`
- fixed parsing attributes with the `_` character in the `HTMLParser`

========================
0.0.5
Expand Down
2 changes: 1 addition & 1 deletion htmlparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function parseHTML(html, trim, onerror, isxml) {
};

var parseAttrs = function(str) {
var attrs = str.match(/[a-z-0-9A-Z\:]+(=("|').*?("|'))?/g);
var attrs = str.match(/[a-z-0-9A-Z\:_-]+(=("|').*?("|'))?/g);
var obj = {};
if (attrs) {
for (var m of attrs) {
Expand Down

0 comments on commit b3330c3

Please sign in to comment.