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

added some markdown stylings

This commit is contained in:
Fedor Katurov 2021-02-24 15:16:24 +07:00
parent d786606924
commit 5dbf4245bf
4 changed files with 82 additions and 7 deletions

11
src/utils/splitText.ts Normal file
View file

@ -0,0 +1,11 @@
import { flatten } from 'ramda';
export const splitTextByYoutube = (strings: string[]): string[] =>
flatten(
strings.map(str =>
str.split(/(https?:\/\/(?:www\.)(?:youtube\.com|youtu\.be)\/(?:watch)(?:\?v=)[\w\-\&\=]+)/)
)
);
export const splitTextOmitEmpty = (strings: string[]): string[] =>
strings.filter(el => !!el.trim());