Skip to content

Commit d5c46b5

Browse files
committed
fix multi-line inside HTML interpolations (fix #3062)
1 parent 4d4059b commit d5c46b5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/parsers/text.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function compileRegex () {
2727
'g'
2828
)
2929
htmlRE = new RegExp(
30-
'^' + unsafeOpen + '.*' + unsafeClose + '$'
30+
'^' + unsafeOpen + '((?:.|\\n)+?)' + unsafeClose + '$'
3131
)
3232
// reset cache
3333
cache = new Cache(1000)

test/unit/specs/parsers/text_spec.js

+7
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ var testCases = [
5050
{ tag: true, value: 'value', html: false, oneTime: false }
5151
]
5252
},
53+
// multiline HTML
54+
{
55+
text: '{{{\n code \n}}}',
56+
expected: [
57+
{ tag: true, value: 'code', html: true, oneTime: false }
58+
]
59+
},
5360
// new lines preserved outside of tags
5461
{
5562
text: 'hello\n{{value}}\nworld',

0 commit comments

Comments
 (0)