Skip to content

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

fix: match paragraph tag shape when detecting HTML content

Gilad Resisiec01d3310ecf
diff --git a/apps/frontend/src/components/new-launch/add.edit.modal.tsx b/apps/frontend/src/components/new-launch/add.edit.modal.tsx
index 644f7ea64..0e18d4263 100644
--- a/apps/frontend/src/components/new-launch/add.edit.modal.tsx
+++ b/apps/frontend/src/components/new-launch/add.edit.modal.tsx
@@ -176,7 +176,7 @@ export const AddEditModalInnerInner: FC<AddEditModalProps> = (props) => {
existingData.posts.map((post) => ({
delay: post.delay,
content:
- post.content.indexOf('<p') > -1
+ /<p[\s>]/i.test(post.content)
? post.content
: post.content
.split('\n')
@@ -201,7 +201,7 @@ export const AddEditModalInnerInner: FC<AddEditModalProps> = (props) => {
props.onlyValues?.length
? props.onlyValues.map((p) => ({
content:
- p.content.indexOf('<p') > -1
+ /<p[\s>]/i.test(p.content)
? p.content
: p.content
.split('\n')
@@ -214,7 +214,7 @@ export const AddEditModalInnerInner: FC<AddEditModalProps> = (props) => {
? props.set.posts[0].value.map((p: any) => ({
id: makeId(10),
content:
- p.content.indexOf('<p') > -1
+ /<p[\s>]/i.test(p.content)
? p.content
: p.content
.split('\n')
diff --git a/libraries/helpers/src/utils/strip.html.validation.ts b/libraries/helpers/src/utils/strip.html.validation.ts
index 813e64570..62e5245e0 100644
--- a/libraries/helpers/src/utils/strip.html.validation.ts
+++ b/libraries/helpers/src/utils/strip.html.validation.ts
@@ -225,7 +225,7 @@ export const stripHtmlValidation = (
.replace(/&lt;/gi, '<');
}
- if (value.indexOf('<p') === -1 && !none) {
+ if (!/<p[\s>]/i.test(value) && !none) {
return value;
}