Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commit8f04135

Browse files
haoqunjiangyyx990803
authored andcommitted
fix(parser): allow CRLFs in string interpolations (vuejs#8408)
fixvuejs#8103
1 parenta64ff19 commit8f04135

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎src/compiler/parser/text-parser.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import{cached}from'shared/util'
44
import{parseFilters}from'./filter-parser'
55

6-
constdefaultTagRE=/\{\{((?:.|\n)+?)\}\}/g
6+
constdefaultTagRE=/\{\{((?:.|\r?\n)+?)\}\}/g
77
constregexEscapeRE=/[-.*+?^${}()|[\]\/\\]/g
88

99
constbuildRegex=cached(delimiters=>{

‎test/unit/modules/compiler/parser.spec.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,4 +731,10 @@ describe('parser', () => {
731731
expect(ast.children[1].isComment).toBe(true)// parse comment with ASTText
732732
expect(ast.children[1].text).toBe('comment here')
733733
})
734+
735+
// #8103
736+
it('should allow CRLFs in string interpolations',()=>{
737+
constast=parse(`<p>{{\r\nmsg\r\n}}</p>`,baseOptions)
738+
expect(ast.children[0].expression).toBe('_s(msg)')
739+
})
734740
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp