@blank-utils/llm 0.3.13 → 0.3.15
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.
|
@@ -1115,8 +1115,10 @@ function cn(...inputs) {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
function sanitizeMarkdownLanguageBlocks(markdown) {
|
|
1117
1117
|
let cleanMarkdown = markdown;
|
|
1118
|
-
cleanMarkdown = cleanMarkdown.replace(/```[
|
|
1119
|
-
cleanMarkdown = cleanMarkdown.replace(/```[ \t]
|
|
1118
|
+
cleanMarkdown = cleanMarkdown.replace(/```([a-zA-Z0-9+#-]*)[_|█▋]+[ \t]*(?:\n|$)/gi, "```$1\n");
|
|
1119
|
+
cleanMarkdown = cleanMarkdown.replace(/```[ \t]*(?:mer(?:m|ma|mai)?|mmd|graphviz)[ \t]*(?:\n|$)/gi, "```mermaid\n");
|
|
1120
|
+
cleanMarkdown = cleanMarkdown.replace(/```[ \t]*(?:m|me)[ \t]*$/gi, "```mermaid\n");
|
|
1121
|
+
cleanMarkdown = cleanMarkdown.replace(/```[ \t]*(?:\n|$)[ \t]*(graph(?: TB| TD| BT| RL| LR)|sequenceDiagram|classDiagram|stateDiagram|pie(?: title)?|flowchart|gantt|journey)/gi, "```mermaid\n$1");
|
|
1120
1122
|
return parseMarkdownIntoBlocks(cleanMarkdown);
|
|
1121
1123
|
}
|
|
1122
1124
|
var CustomMermaidError = ({ error, retry }) => /* @__PURE__ */ jsxs3("div", { className: "rounded-lg border border-red-500/20 bg-red-500/10 p-4 my-4 font-sans", children: [
|
|
@@ -1481,6 +1483,7 @@ function Chat({
|
|
|
1481
1483
|
mermaid: mermaidOptions,
|
|
1482
1484
|
controls: streamdownControls,
|
|
1483
1485
|
parseMarkdownIntoBlocksFn: sanitizeMarkdownLanguageBlocks,
|
|
1486
|
+
caret: "block",
|
|
1484
1487
|
children: streamingText
|
|
1485
1488
|
}
|
|
1486
1489
|
) }) }),
|
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
package/package.json
CHANGED