部分html标签解析不了
发布于 5 年前 作者 shenjuan 1671 次浏览 来自 问答

JS:

var content = res.data.info.content

var content1 = content.replace(/&lt;/g, ‘<’).replace(/&gt;/g, ‘>’).replace(/&quot;/g, ‘"’).replace(/&amp;nbsp;/g, ‘’).replace(/<img src="/g, ‘<img src="http://www.yuyigufen.com)

console.log(content1)

WxParse.wxParse(‘article’, ‘html’, content1, that)

HTML:

<import src="…/…/wxParse/wxParse.wxml" />

<view class=“wxParse” style=“width:{{width}}px”>

<template is=“wxParse” data="{{wxParseData:article.nodes}}" />

</view>

4 回复

wechatide://minicode/chwwqemu6ZZi

html部分代码:

榜单解读:</strong></p><p style=“margin-bottom: 0px; padding: 0px; max-width: 100%; clear: both; min-height: 1em; color: rgb(62, 62, 62); font-family: “Helvetica Neue”, Helvetica, “Hiragino Sans GB”, “Microsoft YaHei”, Arial, sans-serif; line-height: 1.8; text-align: start; widows: 1; word-wrap: break-word !important;”><strong style=“margin: 0px; padding: 0px; max-width: 100%; color: rgb(193, 0, 0); word-wrap: break-word !important;”>一、寡头的布局</strong></p><p style=“margin-bottom: 0px; padding: 0px; max-width: 100%; clear: both; min-height: 1em; color: rgb(62, 62, 62); font-family: “Helvetica Neue”, Helvetica, “Hiragino Sans GB”, “Microsoft YaHei”, Arial, sans-serif; line-height: 1.8; widows: 1; word-wrap: break-word !important;”><strong style=“margin: 0px; padding: 0px; max-width: 100%; color: rgb(193, 0, 0); word-wrap: break-word !important;”>

解析结果:

回到顶部