mirror of https://github.com/zulip/zulip.git
compose: Add parentheses for correct precedence.
This commit is contained in:
parent
693ad9eac8
commit
302e106860
|
@ -321,6 +321,14 @@ people.add(bob);
|
|||
compose.handle_keydown(event);
|
||||
assert.equal("****Anything **bold**.", $('#compose-textarea').val());
|
||||
|
||||
// Test 'i' is typed correctly.
|
||||
$("#compose-textarea").val('i');
|
||||
event.keyCode = undefined;
|
||||
event.which = 73;
|
||||
event.metaKey = false;
|
||||
event.ctrlKey = false;
|
||||
compose.handle_keydown(event);
|
||||
assert.equal("i", $('#compose-textarea').val());
|
||||
// Test italic: ctrl/cmd + i.
|
||||
input_text = "Anything italic";
|
||||
$("#compose-textarea").val(input_text);
|
||||
|
|
|
@ -679,7 +679,7 @@ exports.handle_keydown = function (event) {
|
|||
var isItalic = code === 73 && !event.shiftKey;
|
||||
var isLink = code === 76 && event.shiftKey;
|
||||
|
||||
if (isBold || isItalic || isLink && (event.ctrlKey || event.metaKey)) {
|
||||
if ((isBold || isItalic || isLink) && (event.ctrlKey || event.metaKey)) {
|
||||
function add_markdown(markdown) {
|
||||
var textarea = $("#compose-textarea");
|
||||
var range = textarea.range();
|
||||
|
|
Loading…
Reference in New Issue