pixuireactcomponents 1.3.74 → 1.3.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -13,8 +13,9 @@ export declare namespace tools {
|
|
|
13
13
|
const convertRichText: (str: string) => string;
|
|
14
14
|
/**
|
|
15
15
|
* 富文本组件,将富文本转换成pixui的innerHtml可以使用的格式
|
|
16
|
-
* @param str
|
|
17
|
-
* @
|
|
16
|
+
* @param str 管理端下发的富文本
|
|
17
|
+
* @param aLabelData 返回的富文本中的a标签的跳转数据,[id:string]:jumpdata
|
|
18
|
+
* @returns pixui的innerHtml可以使用的格式
|
|
18
19
|
*/
|
|
19
|
-
const
|
|
20
|
+
const convertRichTextToPixuiStyle: (str: string, aLabelData?: object[]) => string;
|
|
20
21
|
}
|
|
@@ -103,10 +103,11 @@ export var tools;
|
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
105
|
* 富文本组件,将富文本转换成pixui的innerHtml可以使用的格式
|
|
106
|
-
* @param str
|
|
107
|
-
* @
|
|
106
|
+
* @param str 管理端下发的富文本
|
|
107
|
+
* @param aLabelData 返回的富文本中的a标签的跳转数据,[id:string]:jumpdata
|
|
108
|
+
* @returns pixui的innerHtml可以使用的格式
|
|
108
109
|
*/
|
|
109
|
-
tools.
|
|
110
|
+
tools.convertRichTextToPixuiStyle = function (str, aLabelData) {
|
|
110
111
|
var $ = cheerio.load(str, null, false);
|
|
111
112
|
var _loop_1 = function (i) {
|
|
112
113
|
var indent = "ql-indent-".concat(i);
|
|
@@ -216,6 +217,15 @@ export var tools;
|
|
|
216
217
|
$(this).replaceWith("<".concat(tag, " style=\"").concat(tagstyle, "\"><text>").concat(taghtml, "</text></").concat(tag, ">"));
|
|
217
218
|
});
|
|
218
219
|
});
|
|
220
|
+
if (aLabelData) {
|
|
221
|
+
$('a').each(function (i, ele) {
|
|
222
|
+
var id = "PA_RichTextATagId_".concat(i);
|
|
223
|
+
$(this).attr('id', id);
|
|
224
|
+
aLabelData[id] = $(this).attr('href');
|
|
225
|
+
$(this).attr('href', '');
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
//手动处理标签的结尾符
|
|
219
229
|
var res = $.html();
|
|
220
230
|
res = res
|
|
221
231
|
.replaceAll(/<br>/g, '<br />')
|