Skip to content

Commit abb30ee

Browse files
committed
support multiline expressions inside attributes (close #924)
1 parent d3efa2a commit abb30ee

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/parsers/text.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ exports.parse = function (text) {
6565
if (hit) {
6666
return hit
6767
}
68+
text = text.replace(/\n/g, '')
6869
if (!tagRE.test(text)) {
6970
return null
7071
}

test/unit/specs/parsers/text_spec.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ var testCases = [
4343
{ tag: true, value: 'abc', html: false, oneTime: false },
4444
{ value: ']' }
4545
]
46+
},
47+
// multiline
48+
{
49+
text: '{{\n value \n}}',
50+
expected: [
51+
{ tag: true, value: 'value', html: false, oneTime: false }
52+
]
4653
}
4754
]
4855

@@ -120,4 +127,4 @@ describe('Text Parser', function () {
120127
',false)+" e"')
121128
})
122129

123-
})
130+
})

0 commit comments

Comments
 (0)