@pixui-dev/pixui-richtext-helper 0.2.15 → 0.2.17
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/dist/RichTextCore.js +2 -9
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/RichTextCore.js
CHANGED
|
@@ -132,6 +132,7 @@ var mergeStyles = function () {
|
|
|
132
132
|
var CLASS_STYLE_MAP = {
|
|
133
133
|
"ql-direction-rtl": function (old) { return mergeStyles(old, "direction: rtl;"); },
|
|
134
134
|
"ql-align-right": function (old) { return mergeStyles(old, "text-align: right;"); },
|
|
135
|
+
"ql-align-center": function (old) { return mergeStyles(old, "text-align: center;"); },
|
|
135
136
|
};
|
|
136
137
|
// data-list value → 需追加的 class 名
|
|
137
138
|
var DATA_LIST_CLASS_MAP = {
|
|
@@ -389,7 +390,7 @@ var RichTextCore = /** @class */ (function () {
|
|
|
389
390
|
*/
|
|
390
391
|
RichTextCore.processSegment = function (segmentHtml, config) {
|
|
391
392
|
var $ = cheerio.load(segmentHtml, null, false);
|
|
392
|
-
// 预处理:data-list → class、class → style
|
|
393
|
+
// 预处理:data-list → class、class → style、margin→padding 合并
|
|
393
394
|
this.preprocess($);
|
|
394
395
|
// 规范图片尺寸单位:img 的 width/height 数字补 px
|
|
395
396
|
this.fixImgSizeUnit($);
|
|
@@ -497,14 +498,6 @@ var RichTextCore = /** @class */ (function () {
|
|
|
497
498
|
}
|
|
498
499
|
}
|
|
499
500
|
});
|
|
500
|
-
// 在所有标题标签后插入换行 <br>
|
|
501
|
-
$("h1, h2, h3, h4, h5, h6").each(function () {
|
|
502
|
-
// 若标题后紧跟已有换行则不再追加
|
|
503
|
-
var next = $(this).next();
|
|
504
|
-
if (!next.is("br")) {
|
|
505
|
-
$(this).after("<br>");
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
501
|
// 将所有的margin-left,margin-right转换为padding-left,padding-right
|
|
509
502
|
$("*").each(function () {
|
|
510
503
|
var oriStyle = $(this).attr("style") || "";
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.2.
|
|
1
|
+
export declare const LIB_VERSION = "0.2.17";
|
package/dist/version.js
CHANGED