diff --git a/.env b/.env deleted file mode 100644 index bfd29ef4..00000000 --- a/.env +++ /dev/null @@ -1,5 +0,0 @@ -#API_HOST = http://localhost:7777/ -#REMOTE_CURRENT = http://localhost:7777/static/ -REACT_APP_API_HOST = https://pig.staging.vault48.org/ -REACT_APP_REMOTE_CURRENT = https://pig.staging.vault48.org/static/ -EXPOSE = 4000 diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 43b981ea..700015c3 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -94,8 +94,8 @@ export const getURL = (file: Partial, size?: typeof PRESETS[keyof typeof }; export const formatText = pipe( - formatTextSanitizeYoutube, formatTextSanitizeTags, + formatTextSanitizeYoutube, formatTextClickableUsernames, formatTextComments, formatTextTodos, @@ -112,10 +112,12 @@ export const findBlockType = (line: string): ValueOf }; export const splitCommentByBlocks = (text: string): ICommentBlock[] => - text.split('\n').map(line => ({ - type: findBlockType(line), - content: line, - })); + text + .split(/(https?:\/\/(?:www\.)(?:youtube\.com|youtu\.be)\/(?:watch)(?:\?v=)[\w\-\&\=]+)/) + .map(line => ({ + type: findBlockType(line), + content: line, + })); export const formatCommentText = (author: string, text: string): ICommentBlock[] => text ? splitCommentByBlocks(formatText(text)) : null;