Skip to content

Commit d0f0086

Browse files
committed
Merge pull request #12 from 'brettcrowell/control-characters-in-attributes'
2 parents 79ddeb8 + b93c215 commit d0f0086

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/parse-tag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var attrRE = /([\w-]+)|(['"])(.*?)\2/g;
1+
var attrRE = /([\w-]+)|(['"])([.\s\S]*?)\2/g;
22

33
// create optimized lookup object for
44
// void elements as listed here:

test/parse-tag.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ test('parseTag', function (t) {
6666
voidElement: false,
6767
children: []
6868
});
69+
70+
tag = '<textarea placeholder=\'Hey Usher, \n\nAre these modals for real?!\' class=\'placeholder-value\'>';
71+
72+
t.deepEqual(parseTag(tag), {
73+
type: 'tag',
74+
attrs: {
75+
placeholder: 'Hey Usher, \n\nAre these modals for real?!',
76+
class: 'placeholder-value'
77+
},
78+
name: 'textarea',
79+
voidElement: false,
80+
children: []
81+
});
6982

7083
t.end();
7184
});

0 commit comments

Comments
 (0)