Remove strikethrough, comments, and footnotes from `textContent` 444d6527
Jack Platten · 2026-05-24 15:02 1 file(s) · +3 −0
packages/cli/src/lib/markdown.ts +3 −0
388 388
		.replace(/`([^`]+)`/g, "$1") // Remove inline code formatting
389 389
		.replace(/!\[.*?\]\(.*?\)/g, "") // Remove images
390 390
		.replace(/\n{3,}/g, "\n\n") // Normalize multiple newlines
391 +
		.replace(/~~([^~]+)~~/g, "$1") // Remove strikethrough
392 +
		.replace(/<!--([^]+)-->/g, "") // Remove any html comments
393 +
		.replace(/^\s*\[\^[^\]]+\]:[^\r\n]*(?:\r?\n[ \t]+[^\r\n]*)*/gm, "") // Remove any footnotes
391 394
		.trim();
392 395
}