|
|
@@ -56,8 +56,8 @@ const decodingMap = {
|
|
|
'&': '&',
|
|
|
' ': '\n'
|
|
|
}
|
|
|
-const encodedAttr = /&(lt|gt|quot|amp);/g
|
|
|
-const encodedAttrWithNewLines = /&(lt|gt|quot|amp|#10);/g
|
|
|
+const encodedAttr = /&(?:lt|gt|quot|amp);/g
|
|
|
+const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10);/g
|
|
|
|
|
|
function decodeAttr (value, shouldDecodeNewlines) {
|
|
|
const re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr
|
|
|
@@ -210,7 +210,7 @@ export function parseHTML (html, options) {
|
|
|
|
|
|
function handleStartTag (match) {
|
|
|
const tagName = match.tagName
|
|
|
- let unarySlash = match.unarySlash
|
|
|
+ const unarySlash = match.unarySlash
|
|
|
|
|
|
if (expectHTML) {
|
|
|
if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
|
|
|
@@ -246,7 +246,6 @@ export function parseHTML (html, options) {
|
|
|
if (!unary) {
|
|
|
stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs })
|
|
|
lastTag = tagName
|
|
|
- unarySlash = ''
|
|
|
}
|
|
|
|
|
|
if (options.start) {
|