Rich Text Editor (WIP)

This commit is contained in:
mgabdev
2020-06-12 12:01:54 -04:00
parent eb89d552ce
commit 20a3221c4b
11 changed files with 144 additions and 139 deletions

View File

@@ -263,7 +263,7 @@ export function submitCompose(group, replyToId = null, router, isStandalone) {
if (!me) return;
let status = getState().getIn(['compose', 'text'], '');
const markdown = getState().getIn(['compose', 'markdown'], '');
let markdown = getState().getIn(['compose', 'markdown'], '');
const media = getState().getIn(['compose', 'media_attachments']);
// : hack :
@@ -276,10 +276,13 @@ export function submitCompose(group, replyToId = null, router, isStandalone) {
}
return hasProtocol ? match : `http://${match}`
})
// markdown = statusMarkdown.replace(urlRegex, (match) =>{
// const hasProtocol = match.startsWith('https://') || match.startsWith('http://')
// return hasProtocol ? match : `http://${match}`
// })
markdown = markdown.replace(urlRegex, (match) =>{
const hasProtocol = match.startsWith('https://') || match.startsWith('http://')
if (!hasProtocol) {
if (status.indexOf(`@${match}`) > -1) return match
}
return hasProtocol ? match : `http://${match}`
})
const inReplyToId = getState().getIn(['compose', 'in_reply_to'], null) || replyToId