mirror of https://github.com/zulip/zulip.git
commit: Disable automatic numbering / bulleting when inside code block.
This commit is contained in:
parent
602d1d7323
commit
db9ac4b674
|
@ -153,6 +153,10 @@ export function should_enter_send(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handle_bulleting_or_numbering($textarea, e) {
|
function handle_bulleting_or_numbering($textarea, e) {
|
||||||
|
// We only want this functionality if the cursor is not in a code block
|
||||||
|
if (compose_ui.cursor_inside_code_block($textarea)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// handles automatic insertion or removal of bulleting or numbering
|
// handles automatic insertion or removal of bulleting or numbering
|
||||||
const before_text = split_at_cursor($textarea.val(), $textarea)[0];
|
const before_text = split_at_cursor($textarea.val(), $textarea)[0];
|
||||||
const previous_line = bulleted_numbered_list_util.get_last_line(before_text);
|
const previous_line = bulleted_numbered_list_util.get_last_line(before_text);
|
||||||
|
|
|
@ -17,6 +17,7 @@ const compose_ui = mock_esm("../src/compose_ui", {
|
||||||
autosize_textarea() {
|
autosize_textarea() {
|
||||||
autosize_called = true;
|
autosize_called = true;
|
||||||
},
|
},
|
||||||
|
cursor_inside_code_block: () => false,
|
||||||
});
|
});
|
||||||
const compose_validate = mock_esm("../src/compose_validate", {
|
const compose_validate = mock_esm("../src/compose_validate", {
|
||||||
validate_message_length: () => true,
|
validate_message_length: () => true,
|
||||||
|
|
Loading…
Reference in New Issue