feat: fix text replacement

This commit is contained in:
Nevo David 2024-12-20 17:36:20 +07:00
parent 1a2937b518
commit 657c814889
1 changed files with 9 additions and 0 deletions

View File

@ -287,6 +287,15 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
const splitAll = text.split(pattern);
const splitTextReformat = splitAll.map((p) => {
return p
.replace(/</g, '\\<')
.replace(/>/g, '\\>')
.replace(/#/g, '\\#')
.replace(/~/g, '\\~')
.replace(/_/g, '\\_')
.replace(/\\/g, '\\\\')
.replace(/\|/g, '\\|')
.replace(/\[/g, '\\[')
.replace(/]/g, '\\]')
.replace(/\*/g, '\\*')
.replace(/\(/g, '\\(')
.replace(/\)/g, '\\)')