make inline modals smoother

master
Aevann 2024-04-20 17:23:12 +02:00
parent 7a79da454e
commit 3324a72985
3 changed files with 3 additions and 3 deletions

View File

@ -95,7 +95,7 @@ function populate_inline_emoji_modal(results, textbox)
emoji_option.addEventListener('click', () => {
close_inline_emoji_modal()
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `:${name}: `)
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=[^\\w-]|$)", "gi"), `:${name}: `)
textbox.focus()
if (typeof markdown === "function" && textbox.dataset.preview) {
markdown(textbox)

View File

@ -105,7 +105,7 @@ function populate_inline_group_modal(results, textbox)
group_option.addEventListener('click', () => {
close_inline_emoji_modal()
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `!${name} `)
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=[^\\w-]|$)", "gi"), `!${name} `)
textbox.focus()
if (typeof markdown === "function" && textbox.dataset.preview) {
markdown(textbox)

View File

@ -109,7 +109,7 @@ function populate_inline_user_modal(results, textbox)
user_option.addEventListener('click', () => {
close_inline_emoji_modal()
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `@${name} `)
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=[^\\w-]|$)", "gi"), `@${name} `)
textbox.focus()
if (typeof markdown === "function" && textbox.dataset.preview) {
markdown(textbox)