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

showing text nodes

This commit is contained in:
Fedor Katurov 2019-10-17 14:46:07 +07:00
parent 54ce8db210
commit 1552e88ddd
2 changed files with 8 additions and 4 deletions

View file

@ -2,10 +2,10 @@
@include outer_shadow();
background: $content_bg;
padding: $gap;
padding: $gap * 4;
border-radius: $radius;
p {
margin: $gap / 2 0;
margin: $gap 0;
}
}

View file

@ -67,8 +67,10 @@ export const getURL = (file: Partial<IFile>) => {
export const getImageSize = (file: IFile, size?: string): string => getURL(file);
// `${process.env.API_HOST}${image}`.replace('{size}', size);
export const formatCommentText = (author, text: string) =>
text
export const formatCommentText = (author, text: string) => {
if (!text) return '';
return text
.replace(/(\n{2,})/gi, '\n')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
@ -82,6 +84,8 @@ export const formatCommentText = (author, text: string) =>
: `<p>${el}</p>`
)
.join('');
};
// .replace(/\/\*(\*(?!\/)|[^*])*\*\//igm, '');
export const getPrettyDate = (date: string): string =>