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:
parent
54ce8db210
commit
1552e88ddd
2 changed files with 8 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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, '<')
|
||||
.replace(/>/g, '>')
|
||||
|
@ -82,6 +84,8 @@ export const formatCommentText = (author, text: string) =>
|
|||
: `<p>${el}</p>`
|
||||
)
|
||||
.join('');
|
||||
};
|
||||
|
||||
// .replace(/\/\*(\*(?!\/)|[^*])*\*\//igm, '');
|
||||
|
||||
export const getPrettyDate = (date: string): string =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue