Skip to content

Commit

Permalink
fix(h5): multiple classes (rich-text) #756
Browse files Browse the repository at this point in the history
  • Loading branch information
fxy060608 committed Sep 11, 2019
1 parent db1522a commit a8d94c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/view/components/rich-text/nodes-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const CHARS = {
'nbsp': ' ',
'quot': '"',
'apos': "'"
}
}

function decodeEntities (htmlString) {
return htmlString.replace(/&(([a-zA-Z]+)|(#x{0,1}[\da-zA-Z]+));/gi, function (match, stage) {
Expand Down Expand Up @@ -95,9 +95,11 @@ export default function parseNodes (nodes, parentNode) {
if (isPlainObject(attrs)) {
const tagAttrs = TAGS[tagName] || []
Object.keys(attrs).forEach(function (name) {
const value = attrs[name]
let value = attrs[name]
switch (name) {
case 'class':
/* eslint-disable no-fallthrough */
Array.isArray(value) && (value = value.join(' '))
case 'style':
elem.setAttribute(name, value)
break
Expand Down

0 comments on commit a8d94c0

Please sign in to comment.