@bhsd/common 1.3.0 → 1.3.1

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/index.js CHANGED
@@ -51,7 +51,8 @@ exports.splitColors = splitColors;
51
51
  * 清理内联样式中的`{`和`}`
52
52
  * @param style 内联样式
53
53
  */
54
- const sanitizeInlineStyle = (style) => style.replace(/[{}]/gu, p => p === '{' ? '{' : '}');
54
+ const sanitizeInlineStyle = (style) => style.replace(/[{}]/gu, p => p === '{' ? '{' : '}')
55
+ .replace(/^[\s;]+/u, p => p.replace(/;/gu, ' '));
55
56
  exports.sanitizeInlineStyle = sanitizeInlineStyle;
56
57
  function getRegex(f) {
57
58
  const map = new Map(), weakMap = new WeakMap();
package/dist/index.mjs CHANGED
@@ -305,7 +305,7 @@ var splitColors = (str, hsl = true) => {
305
305
  }
306
306
  return pieces;
307
307
  };
308
- var sanitizeInlineStyle = (style) => style.replace(/[{}]/gu, (p) => p === "{" ? "{" : "}");
308
+ var sanitizeInlineStyle = (style) => style.replace(/[{}]/gu, (p) => p === "{" ? "{" : "}").replace(/^[\s;]+/u, (p) => p.replace(/;/gu, " "));
309
309
  function getRegex(f) {
310
310
  const map = /* @__PURE__ */ new Map(), weakMap = /* @__PURE__ */ new WeakMap();
311
311
  return (s) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bhsd/common",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "homepage": "https://github.com/bhsd-harry/common#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/bhsd-harry/common/issues"