1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

added insane to sanitize html

This commit is contained in:
Fedor Katurov 2021-02-24 17:55:23 +07:00
parent 165039c177
commit b58ddba328
6 changed files with 93 additions and 14 deletions

View file

@ -1,4 +1,5 @@
import marked from 'marked';
import { stripHTMLTags } from '~/utils/stripHTMLTags';
/**
* Cleans youtube urls
@ -12,8 +13,7 @@ export const formatTextSanitizeYoutube = (text: string): string =>
/**
* Removes HTML tags
*/
export const formatTextSanitizeTags = (text: string): string =>
text.replace(/</g, '&lt;').replace(/>/g, '&gt;');
export const formatTextSanitizeTags = (text: string): string => stripHTMLTags(text);
/**
* Returns clickable usernames