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

fixed formatting empty text

This commit is contained in:
Fedor Katurov 2019-11-27 14:04:21 +07:00
parent 09f5ab3c08
commit c77e8e677a
2 changed files with 10 additions and 8 deletions

View file

@ -100,10 +100,12 @@ export const formatText = (text: string): string =>
.join('\n');
export const formatTextParagraphs = (text: string): string =>
text
.split('\n')
.map(str => `<p>${str}</p>`)
.join('\n');
(text &&
text
.split('\n')
.map(str => `<p>${str}</p>`)
.join('\n')) ||
null;
export const findBlockType = (line: string): ValueOf<typeof COMMENT_BLOCK_TYPES> => {
const match = Object.values(COMMENT_BLOCK_DETECTORS).find(detector => line.match(detector.test));