diff --git a/src/compiler/parser/text-parser.js b/src/compiler/parser/text-parser.js index 284fca33bf..cf82a62484 100644 --- a/src/compiler/parser/text-parser.js +++ b/src/compiler/parser/text-parser.js @@ -3,7 +3,7 @@ import { cached } from 'shared/util' import { parseFilters } from './filter-parser' -const defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g +const defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g const regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g const buildRegex = cached(delimiters => { diff --git a/test/unit/modules/compiler/parser.spec.js b/test/unit/modules/compiler/parser.spec.js index 750e371105..b5c15123ff 100644 --- a/test/unit/modules/compiler/parser.spec.js +++ b/test/unit/modules/compiler/parser.spec.js @@ -717,4 +717,10 @@ describe('parser', () => { expect(ast.children[1].isComment).toBe(true) // parse comment with ASTText expect(ast.children[1].text).toBe('comment here') }) + + // #8103 + it('should allow CRLFs in string interpolations', () => { + const ast = parse(`

{{\r\nmsg\r\n}}

`, baseOptions) + expect(ast.children[0].expression).toBe('_s(msg)') + }) })