提交 a8d94c07 编写于 作者: fxy060608's avatar fxy060608

fix(h5): multiple classes (rich-text) #756

上级 db1522a0
......@@ -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) {
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册