pixuireactcomponents 1.3.64 → 1.3.65
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
|
@@ -78,17 +78,17 @@ tools.getHashStr = function (str) {
|
|
|
78
78
|
tools.convertRichText = function (str) {
|
|
79
79
|
var res = str
|
|
80
80
|
.replaceAll(/<img([^>]*)>/g, '<img$1></img>') //传过来的这两个标签会少结束标签
|
|
81
|
-
.replaceAll(/<h[1,2,3,4,5,6]><br><\/h[1,2,3,4,5,6]>/g, '<br /><div style = "width:50px;height:15px;"
|
|
82
|
-
.replaceAll(/<br>/g, '<br /><div style = "width:50px;height:15px;"
|
|
81
|
+
.replaceAll(/<h[1,2,3,4,5,6]><br><\/h[1,2,3,4,5,6]>/g, '<br /><div style = "width:50px;height:15px;" ></div>')
|
|
82
|
+
.replaceAll(/<p><br><\/p>/g, '<br /><div style = "width:50px;height:15px;" ></div>')
|
|
83
83
|
.replaceAll(/<p/g, '<text')
|
|
84
84
|
.replaceAll(/<\/p>/g, '</text>') //包text否则会丢break word
|
|
85
85
|
.replaceAll(/<span/g, '<text')
|
|
86
86
|
.replaceAll(/<\/span>/g, '</text>') //包text否则会丢break word
|
|
87
87
|
.replaceAll(/ /g, ' '); //单一行只有nbsp的时候,会整个解析不出来,pixui innerHtml bug
|
|
88
88
|
for (var i = 1; i <= 6; i++) {
|
|
89
|
-
res = res.replaceAll(
|
|
90
|
-
res = res.replaceAll("</h".concat(i, ">"), "</text></h".concat(i, ">"));
|
|
89
|
+
res = res.replaceAll(/(<h${i}\s[^>]*>)([^<]*)(<\/h${i}>)/g, '$1<text>$2</text>$3'); //h1-h6的内容包 text
|
|
91
90
|
}
|
|
91
|
+
res = res.replaceAll(/<br>/g, '<br /><div style = "width:50px;height:15px;" ></div>');
|
|
92
92
|
for (var i = 1; i < 10; i++) {
|
|
93
93
|
res = res.replaceAll("class=\"ql-indent-".concat(i, "\""), " style=\"padding-left: ".concat(i * 2, "rem;\""));
|
|
94
94
|
}
|