From cf8ece9d8d39cb9b2c120f467886819e8f01334f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=9F=E5=81=A5?= <384709054@qq.com> Date: Mon, 25 Dec 2017 23:50:36 +0800 Subject: [PATCH] fix: allow codebase to be inlined directly in HTML (#7314) escape - to avoid regex being parsed as HTML comment when entire codebase is inlined. fix #7298 --- src/compiler/parser/html-parser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/parser/html-parser.js b/src/compiler/parser/html-parser.js index 86955e0e7ab..e2203613204 100644 --- a/src/compiler/parser/html-parser.js +++ b/src/compiler/parser/html-parser.js @@ -22,7 +22,8 @@ const startTagOpen = new RegExp(`^<${qnameCapture}`) const startTagClose = /^\s*(\/?)>/ const endTag = new RegExp(`^<\\/${qnameCapture}[^>]*>`) const doctype = /^]+>/i -const comment = /^/g, '$1') + .replace(//g, '$1') // #7298 .replace(//g, '$1') } if (shouldIgnoreFirstNewline(stackedTag, text)) {