Rich Text Editor (WIP) x3
This commit is contained in:
@@ -268,7 +268,7 @@ export function submitCompose(group, replyToId = null, router, isStandalone) {
|
||||
|
||||
// : hack :
|
||||
//Prepend http:// to urls in status that don't have protocol
|
||||
status = status.replace(urlRegex, (match, a, b, c) =>{
|
||||
status = `${status}`.replace(urlRegex, (match, a, b, c) =>{
|
||||
const hasProtocol = match.startsWith('https://') || match.startsWith('http://')
|
||||
//Make sure not a remote mention like @someone@somewhere.com
|
||||
if (!hasProtocol) {
|
||||
@@ -276,18 +276,20 @@ export function submitCompose(group, replyToId = null, router, isStandalone) {
|
||||
}
|
||||
return hasProtocol ? match : `http://${match}`
|
||||
})
|
||||
markdown = markdown.replace(urlRegex, (match) =>{
|
||||
markdown = !!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}`
|
||||
})
|
||||
}) : undefined
|
||||
|
||||
if (status === markdown) {
|
||||
markdown = undefined
|
||||
}
|
||||
|
||||
const inReplyToId = getState().getIn(['compose', 'in_reply_to'], null) || replyToId
|
||||
|
||||
// console.log("markdown:", markdown)
|
||||
|
||||
dispatch(submitComposeRequest());
|
||||
dispatch(closeModal());
|
||||
|
||||
@@ -709,9 +711,9 @@ export function changeScheduledAt(date) {
|
||||
};
|
||||
};
|
||||
|
||||
export function changeRichTextEditorControlsVisibility(status) {
|
||||
export function changeRichTextEditorControlsVisibility(open) {
|
||||
return {
|
||||
type: COMPOSE_RICH_TEXT_EDITOR_CONTROLS_VISIBILITY,
|
||||
status: status,
|
||||
open,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user