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:
parent
54ce8db210
commit
1552e88ddd
2 changed files with 8 additions and 4 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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, '<')
|
.replace(/</g, '<')
|
||||||
.replace(/>/g, '>')
|
.replace(/>/g, '>')
|
||||||
|
@ -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 =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue