diff --git a/src/components/node/NodeTextBlock/styles.scss b/src/components/node/NodeTextBlock/styles.scss index d075cd73..8bcd3b80 100644 --- a/src/components/node/NodeTextBlock/styles.scss +++ b/src/components/node/NodeTextBlock/styles.scss @@ -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; } } diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 00ed1461..15d122f2 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -67,8 +67,10 @@ export const getURL = (file: Partial) => { 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, '>') @@ -82,6 +84,8 @@ export const formatCommentText = (author, text: string) => : `

${el}

` ) .join(''); +}; + // .replace(/\/\*(\*(?!\/)|[^*])*\*\//igm, ''); export const getPrettyDate = (date: string): string =>