1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +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

@ -36,7 +36,6 @@ render(
[stage 1] [stage 1]
- signup? - signup?
- import videos - import videos
- import graffiti
- text post can also has songs http://vault48.org/post5052 - text post can also has songs http://vault48.org/post5052
- fulltext search: https://github.com/typeorm/typeorm/issues/3191 - fulltext search: https://github.com/typeorm/typeorm/issues/3191
- zoom: https://manuelstofer.github.io/pinchzoom/ - zoom: https://manuelstofer.github.io/pinchzoom/
@ -47,6 +46,7 @@ render(
- comment editing - comment editing
Done: Done:
- import graffiti
- <...> format - <...> format
- youtube embeds - youtube embeds
- mobile header - mobile header

View file

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