minutool 1.0.8 → 1.0.9

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.d.ts CHANGED
@@ -773,6 +773,8 @@ export declare const loadScript: (src: string, forceReload?: boolean) => Promise
773
773
  */
774
774
  export declare const lockElementInteraction: (el: HTMLElement | string, payload: (reset: () => void) => void) => void;
775
775
 
776
+ export declare const markdown2Html: (md: string) => string;
777
+
776
778
  /**
777
779
  * 计算字符串的 MD5 哈希值
778
780
  * @param {string} string - 要计算 MD5 的字符串
@@ -1541,6 +1543,15 @@ export declare const stripSlashes: (str: string) => string;
1541
1543
  */
1542
1544
  export declare const strToPascalCase: (str: string, capitalize_first?: boolean) => string;
1543
1545
 
1546
+ /**
1547
+ * 将纯文本转换为 HTML(转义特殊字符并处理换行)
1548
+ * @param {string} text - 纯文本字符串
1549
+ * @returns {string} 返回 HTML 字符串
1550
+ * @example
1551
+ * text2Html('Hello\nWorld') // 'Hello<br/>World'
1552
+ */
1553
+ export declare const text2Html: (text: string) => string;
1554
+
1544
1555
  /**
1545
1556
  * 节流函数
1546
1557
  * 规定在一个单位时间内,只能触发一次函数。如果这个函数单位时间内触发多次函数,只有一次生效。