1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +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(); @include outer_shadow();
background: $content_bg; background: $content_bg;
padding: $gap; padding: $gap * 4;
border-radius: $radius; border-radius: $radius;
p { 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); export const getImageSize = (file: IFile, size?: string): string => getURL(file);
// `${process.env.API_HOST}${image}`.replace('{size}', size); // `${process.env.API_HOST}${image}`.replace('{size}', size);
export const formatCommentText = (author, text: string) => export const formatCommentText = (author, text: string) => {
text if (!text) return '';
return text
.replace(/(\n{2,})/gi, '\n') .replace(/(\n{2,})/gi, '\n')
.replace(/</g, '&lt;') .replace(/</g, '&lt;')
.replace(/>/g, '&gt;') .replace(/>/g, '&gt;')
@ -82,6 +84,8 @@ export const formatCommentText = (author, text: string) =>
: `<p>${el}</p>` : `<p>${el}</p>`
) )
.join(''); .join('');
};
// .replace(/\/\*(\*(?!\/)|[^*])*\*\//igm, ''); // .replace(/\/\*(\*(?!\/)|[^*])*\*\//igm, '');
export const getPrettyDate = (date: string): string => export const getPrettyDate = (date: string): string =>