@sleepwalkerai/cli 0.2.0 → 0.2.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/package.json +1 -1
- package/src/okf.js +5 -1
package/package.json
CHANGED
package/src/okf.js
CHANGED
|
@@ -196,6 +196,10 @@ function htmlToMarkdown(fragment, baseUrl) {
|
|
|
196
196
|
// Drop empty heading markers left when a heading's text lived in nested blocks
|
|
197
197
|
// that were stripped (avoids junk lines like a bare "#" or "##").
|
|
198
198
|
out = out.replace(/^[ \t]*#{1,6}[ \t]*$/gm, "");
|
|
199
|
+
// Strip control/bidi characters BEFORE collapsing: if they sit between
|
|
200
|
+
// newlines they break up blank-line runs, and stripping them afterward would
|
|
201
|
+
// leave long orphaned newline runs that nothing re-collapses.
|
|
202
|
+
out = sanitizeText(out);
|
|
199
203
|
return collapseWhitespace(out);
|
|
200
204
|
}
|
|
201
205
|
|
|
@@ -304,7 +308,7 @@ export function extractConcept(html, url) {
|
|
|
304
308
|
title: sanitizeText(title).slice(0, 300),
|
|
305
309
|
description: sanitizeText(firstSentence || "").slice(0, 300),
|
|
306
310
|
resource,
|
|
307
|
-
body
|
|
311
|
+
body, // already sanitized-then-collapsed inside htmlToMarkdown
|
|
308
312
|
links: links.map((link) => ({ ...link, text: sanitizeText(link.text) })),
|
|
309
313
|
};
|
|
310
314
|
}
|