mirror of https://github.com/zulip/zulip.git
compose: Do not paste formatted markdown when inside a code block.
We usually default to pasting formatted markdown (unless the Shift key is used to paste plainly instead), but when we're inside a code block, we always want to paste plainly.
This commit is contained in:
parent
f5bcf5d608
commit
602d1d7323
|
@ -543,10 +543,16 @@ export function paste_handler(event) {
|
|||
return;
|
||||
}
|
||||
|
||||
// We do not paste formatted markdoown when inside a code block.
|
||||
// Unlike Chrome, Firefox doesn't automatically paste plainly on using Ctrl+Shift+V,
|
||||
// hence we need to handle it ourselves, by checking if shift key is pressed, and only
|
||||
// if not, we proceed with the default formatted paste.
|
||||
if (paste_html && !compose_ui.shift_pressed && page_params.development_environment) {
|
||||
if (
|
||||
!compose_ui.cursor_inside_code_block($textarea) &&
|
||||
paste_html &&
|
||||
!compose_ui.shift_pressed &&
|
||||
page_params.development_environment
|
||||
) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const text = paste_handler_converter(paste_html);
|
||||
|
|
Loading…
Reference in New Issue