Fix:5778 【商城小程序】【商户入驻-入驻申请须知】香道滇小程序展示的“入驻申请须知”段落格式,与香道滇后台管理系统中配置的内容格式不一致
This commit is contained in:
@@ -9,6 +9,15 @@ import stringify from "@/utils/querystring";
|
||||
import {VUE_APP_API_URL} from "@/config";
|
||||
import {auth} from '@/libs/wechat'
|
||||
|
||||
// 富文本内容预处理:
|
||||
// 纯文本内容(不含HTML标签)中的换行符\n在rich-text中会被折叠为空格,需转为<br/>以保留换行格式
|
||||
export function formatRichText(content) {
|
||||
if (!content) return ''
|
||||
// 含HTML标签的富文本内容不做处理,避免破坏原有结构
|
||||
if (/<[a-zA-Z][^>]*>/.test(content)) return content
|
||||
return content.replace(/\r\n/g, '\n').replace(/\n/g, '<br/>')
|
||||
}
|
||||
|
||||
export function dataFormat(time, option) {
|
||||
time = +time * 1000;
|
||||
const d = new Date(time);
|
||||
|
||||
Reference in New Issue
Block a user