Skip to content

Commit

Permalink
Merge pull request #12 from 'brettcrowell/control-characters-in-attri…
Browse files Browse the repository at this point in the history
…butes'
  • Loading branch information
rayd committed Jul 24, 2017
2 parents 79ddeb8 + b93c215 commit d0f0086
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parse-tag.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var attrRE = /([\w-]+)|(['"])(.*?)\2/g;
var attrRE = /([\w-]+)|(['"])([.\s\S]*?)\2/g;

// create optimized lookup object for
// void elements as listed here:
Expand Down
13 changes: 13 additions & 0 deletions test/parse-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ test('parseTag', function (t) {
voidElement: false,
children: []
});

tag = '<textarea placeholder=\'Hey Usher, \n\nAre these modals for real?!\' class=\'placeholder-value\'>';

t.deepEqual(parseTag(tag), {
type: 'tag',
attrs: {
placeholder: 'Hey Usher, \n\nAre these modals for real?!',
class: 'placeholder-value'
},
name: 'textarea',
voidElement: false,
children: []
});

t.end();
});

0 comments on commit d0f0086

Please sign in to comment.