@lobehub/ui 1.165.2 → 1.165.4
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/es/Markdown/index.js +4 -2
- package/es/Markdown/utils.js +3 -1
- package/package.json +1 -1
package/es/Markdown/index.js
CHANGED
|
@@ -81,8 +81,10 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
81
81
|
var isChatMode = variant === 'chat';
|
|
82
82
|
var escapedContent = useMemo(function () {
|
|
83
83
|
if (!enableLatex) return fixMarkdownBold(children);
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
var defaultValue = fixMarkdownBold(escapeMhchem(escapeBrackets(children)));
|
|
85
|
+
if (enableCustomFootnotes) return transformCitations(defaultValue, citations === null || citations === void 0 ? void 0 : citations.length);
|
|
86
|
+
return defaultValue;
|
|
87
|
+
}, [children, enableLatex, enableCustomFootnotes]);
|
|
86
88
|
var memoComponents = useMemo(function () {
|
|
87
89
|
return _objectSpread({
|
|
88
90
|
a: function a(props) {
|
package/es/Markdown/utils.js
CHANGED
|
@@ -57,7 +57,9 @@ export function fixMarkdownBold(text) {
|
|
|
57
57
|
return result;
|
|
58
58
|
}
|
|
59
59
|
export var transformCitations = function transformCitations(rawContent) {
|
|
60
|
-
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
60
|
+
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
61
|
+
if (length === 0) return rawContent;
|
|
62
|
+
|
|
61
63
|
// 生成动态正则表达式模式
|
|
62
64
|
var idx = Array.from({
|
|
63
65
|
length: length
|