π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
feat: prevent html parsing when there is not html
Nevo David3cc2ddc47c84
diff --git a/apps/frontend/src/components/launches/calendar.tsx b/apps/frontend/src/components/launches/calendar.tsxindex 86302729d..98a950632 100644--- a/apps/frontend/src/components/launches/calendar.tsx+++ b/apps/frontend/src/components/launches/calendar.tsx@@ -911,7 +911,7 @@ const CalendarItem: FC<{</div><div className="w-full relative"><div className="absolute top-0 start-0 w-full text-ellipsis break-words line-clamp-1 text-left">- {stripHtmlValidation('none', post.content, false, true) ||+ {stripHtmlValidation('none', post.content, false, true, false) ||'no content'}</div></div>diff --git a/libraries/helpers/src/utils/strip.html.validation.ts b/libraries/helpers/src/utils/strip.html.validation.tsindex 870494d18..e5abdab40 100644--- a/libraries/helpers/src/utils/strip.html.validation.ts+++ b/libraries/helpers/src/utils/strip.html.validation.ts@@ -136,8 +136,14 @@ export const stripHtmlValidation = (val: string,replaceBold = false,none = false,+ plain = false,convertMentionFunction?: (idOrHandle: string, name: string) => string): string => {++ if (plain) {+ return val;+ }+const value = serialize(parseFragment(val));if (type === 'html') {diff --git a/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts b/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.tsindex 0a3d76423..06b362dd4 100644--- a/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts+++ b/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts@@ -44,6 +44,7 @@ type PostWithConditionals = Post & {childrenPost: Post[];};+@Injectable()export class PostsService {private storage = UploadFactory.createStorage();@@ -478,6 +479,7 @@ export class PostsService {p.content,true,false,+ !(/<\/?[a-z][\s\S]*>/i.test(p.content)),getIntegration.mentionFormat),settings: JSON.parse(p.settings || '{}'),