Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

fix(posts): keep the block-tag rewrite linear on unclosed tags

Gilad Resisi2ded21d14513
diff --git a/libraries/helpers/src/utils/sanitize.post.content.ts b/libraries/helpers/src/utils/sanitize.post.content.ts
index cd298bab8..b6333c314 100644
--- a/libraries/helpers/src/utils/sanitize.post.content.ts
+++ b/libraries/helpers/src/utils/sanitize.post.content.ts
@@ -47,7 +47,7 @@ export const sanitizePostContent = (value: unknown): string => {
// a block tag the editor doesn't know would be dropped with its text kept,
// gluing its line to the next one
const paragraphs = value.replace(
- /<(\/?)(div|section|article|blockquote|pre|h[4-6])\b[^>]*>/gi,
+ /<(\/?)(div|section|article|blockquote|pre|h[4-6])\b[^<>]*>/gi,
'<$1p>'
);