Change d-editor to use _ instead of * for italics.

This commit is contained in:
Robin Ward 2016-01-18 14:54:37 -05:00
parent 4e8a2981a7
commit 57c3d65777
2 changed files with 4 additions and 4 deletions
app/assets/javascripts/discourse/components
test/javascripts/components

View file

@ -42,7 +42,7 @@ function Toolbar() {
id: 'italic',
group: 'fontStyles',
shortcut: 'I',
perform: e => e.applySurround('*', '*', 'italic_text')
perform: e => e.applySurround('_', '_', 'italic_text')
});
this.addButton({id: 'link', group: 'insertions', shortcut: 'K', action: 'showLinkModal'});

View file

@ -130,7 +130,7 @@ testCase(`italic button with no selection`, function(assert, textarea) {
click(`button.italic`);
andThen(() => {
const example = I18n.t(`composer.italic_text`);
assert.equal(this.get('value'), `hello world.*${example}*`);
assert.equal(this.get('value'), `hello world._${example}_`);
assert.equal(textarea.selectionStart, 13);
assert.equal(textarea.selectionEnd, 13 + example.length);
@ -143,7 +143,7 @@ testCase(`italic button with a selection`, function(assert, textarea) {
click(`button.italic`);
andThen(() => {
assert.equal(this.get('value'), `hello *world*.`);
assert.equal(this.get('value'), `hello _world_.`);
assert.equal(textarea.selectionStart, 7);
assert.equal(textarea.selectionEnd, 12);
});
@ -166,7 +166,7 @@ testCase(`italic with a multiline selection`, function (assert, textarea) {
click(`button.italic`);
andThen(() => {
assert.equal(this.get('value'), `*hello*\n\n*world*\n\ntest.`);
assert.equal(this.get('value'), `_hello_\n\n_world_\n\ntest.`);
assert.equal(textarea.selectionStart, 0);
assert.equal(textarea.selectionEnd, 16);
});