feat: convert lt and gt to \> and \< in markdown

This commit is contained in:
Nevo David 2025-09-22 00:14:52 +07:00
parent f0f8373621
commit b98522373d
2 changed files with 4 additions and 3 deletions

View File

@ -139,7 +139,6 @@ export const stripHtmlValidation = (
plain = false,
convertMentionFunction?: (idOrHandle: string, name: string) => string
): string => {
if (plain) {
return val;
}
@ -169,6 +168,8 @@ export const stripHtmlValidation = (
})
.replace(/&amp;/gi, '&')
.replace(/&nbsp;/gi, ' ')
.replace(/&gt;/gi, '>')
.replace(/&lt;/gi, '<')
.replace(/<h2>([.\s\S]*?)<\/h2>/g, (match, p1) => {
return `<h2>## ${p1}</h2>\n`;
})
@ -209,7 +210,7 @@ export const stripHtmlValidation = (
.replace(/<p[^>]*>/gi, '\n')
.replace(/<\/p>/gi, '')
.replace(/&gt;/gi, '>')
.replace(/&lt;/gi, '<')
.replace(/&lt;/gi, '<');
if (none) {
return striptags(html);

View File

@ -618,7 +618,7 @@ export class InstagramProvider
).json();
arr.push({
id: firstPost.id,
id: post.id,
postId: commentId,
releaseURL: linkGlobal,
status: 'success',