Handle 1 or 2 tildes using backreference 42b08e1d
Jack Platten · 2026-05-25 10:34 1 file(s) · +1 −1
packages/cli/src/lib/markdown.ts +1 −1
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
391 +
		.replace(/(~{1,2})([^~]+?)\1/g, "$2") // Remove strikethrough for ~text~ and ~~text~~
392 392
		.replace(/<!--([^]+)-->/g, "") // Remove any html comments
393 393
		.replace(/^\s*\[\^[^\]]+\]:[^\r\n]*(?:\r?\n[ \t]+[^\r\n]*)*/gm, "") // Remove any footnotes
394 394
		.trim();