From 316336d138a6f28e77d3b206020954d046e3e010 Mon Sep 17 00:00:00 2001 From: bughit Date: Fri, 18 Jan 2019 16:38:32 -0500 Subject: [PATCH] decode single quotes in html attributes pretty much everything in the ruby world, html escapes single quotes https://github.com/ruby/ruby/blob/trunk/lib/cgi/util.rb#L30 so, for example, haml pre-processed vue templates will have single quotes escaped --- src/compiler/parser/html-parser.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compiler/parser/html-parser.js b/src/compiler/parser/html-parser.js index 1b304fbdb6a..7952b903ca8 100644 --- a/src/compiler/parser/html-parser.js +++ b/src/compiler/parser/html-parser.js @@ -35,10 +35,11 @@ const decodingMap = { '"': '"', '&': '&', ' ': '\n', - ' ': '\t' + ' ': '\t', + ''': "'" } -const encodedAttr = /&(?:lt|gt|quot|amp);/g -const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10|#9);/g +const encodedAttr = /&(?:lt|gt|quot|amp|#39);/g +const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g // #5992 const isIgnoreNewlineTag = makeMap('pre,textarea', true)