add testing suite
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/** Strip markdown artifacts and normalize whitespace. Pure, no side effects. */
|
||||
export function cleanText(str) {
|
||||
if (!str) return "";
|
||||
return str
|
||||
.replace(/^#+\s*/gm, "")
|
||||
.replace(/\*\*(.*?)\*\*/g, "$1")
|
||||
.replace(/[*_`]/g, "")
|
||||
.replace(/\s+/g, " ")
|
||||
.trim();
|
||||
}
|
||||
Reference in New Issue
Block a user