@ai-matrx/print 0.8.6 → 0.8.7
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/CHANGELOG.md +10 -0
- package/dist/document.cjs +2 -1
- package/dist/document.cjs.map +1 -1
- package/dist/document.js +2 -1
- package/dist/document.js.map +1 -1
- package/dist/markdown.cjs +2 -1
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.js +2 -1
- package/dist/markdown.js.map +1 -1
- package/package.json +3 -3
package/dist/markdown.cjs
CHANGED
|
@@ -1098,7 +1098,8 @@ function splitAtPageBreaks(markdown) {
|
|
|
1098
1098
|
// src/markdown.ts
|
|
1099
1099
|
function removeThinkingContent(content) {
|
|
1100
1100
|
if (!content) return "";
|
|
1101
|
-
|
|
1101
|
+
const hide = (_match, before, after) => before.length >= 2 || after.length >= 2 ? "\n\n" : "\n";
|
|
1102
|
+
let result = content.replace(/(\n*)<thinking>[\s\S]*?<\/thinking>(\n*)/gi, hide).replace(/(\n*)<think>[\s\S]*?<\/think>(\n*)/gi, hide).replace(/(\n*)<reasoning>[\s\S]*?<\/reasoning>(\n*)/gi, hide);
|
|
1102
1103
|
result = result.replace(/\n{3,}/g, "\n\n");
|
|
1103
1104
|
return result.trim();
|
|
1104
1105
|
}
|