diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index 07cb6872a7a..313bfea7a41 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -101,24 +101,6 @@ class Toolbar { perform: e => e.applyList(i => !i ? "1. " : `${parseInt(i) + 1}. `, 'list_item') }); - this.addButton({ - id: 'heading', - group: 'extras', - icon: 'header', - label: getButtonLabel('composer.heading_label', 'H'), - shortcut: 'Alt+1', - perform: e => e.applyList('## ', 'heading_text') - }); - - this.addButton({ - id: 'rule', - group: 'extras', - icon: 'minus', - shortcut: 'Alt+R', - title: 'composer.hr_title', - perform: e => e.addText("\n\n----------\n") - }); - if (site.mobileView) { this.groups.push({group: 'mobileExtras', buttons: []}); } diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 82db49a2ed5..45bc066d7d8 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1253,10 +1253,6 @@ en: olist_title: "Numbered List" ulist_title: "Bulleted List" list_item: "List item" - heading_label: "H" - heading_title: "Heading" - heading_text: "Heading" - hr_title: "Horizontal Rule" help: "Markdown Editing Help" toggler: "hide or show the composer panel" modal_ok: "OK" diff --git a/test/javascripts/components/d-editor-test.js.es6 b/test/javascripts/components/d-editor-test.js.es6 index 8bc3b0d09d8..07242c4e330 100644 --- a/test/javascripts/components/d-editor-test.js.es6 +++ b/test/javascripts/components/d-editor-test.js.es6 @@ -692,66 +692,6 @@ testCase(`list button with line sequence`, function(assert, textarea) { }); }); -testCase(`heading button with no selection`, function(assert, textarea) { - const example = I18n.t('composer.heading_text'); - - click(`button.heading`); - andThen(() => { - assert.equal(this.get('value'), `hello world.\n\n## ${example}`); - assert.equal(textarea.selectionStart, 14); - assert.equal(textarea.selectionEnd, 17 + example.length); - }); - - textarea.selectionStart = 30; - textarea.selectionEnd = 30; - click(`button.heading`); - andThen(() => { - assert.equal(this.get('value'), `hello world.\n\n${example}`); - assert.equal(textarea.selectionStart, 14); - assert.equal(textarea.selectionEnd, 14 + example.length); - }); -}); - -testCase(`rule between things`, function(assert, textarea) { - textarea.selectionStart = 5; - textarea.selectionEnd = 5; - - click(`button.rule`); - andThen(() => { - assert.equal(this.get('value'), `hello\n\n----------\n world.`); - assert.equal(textarea.selectionStart, 18); - assert.equal(textarea.selectionEnd, 18); - }); -}); - -testCase(`rule with no selection`, function(assert, textarea) { - click(`button.rule`); - andThen(() => { - assert.equal(this.get('value'), `hello world.\n\n----------\n`); - assert.equal(textarea.selectionStart, 25); - assert.equal(textarea.selectionEnd, 25); - }); - - click(`button.rule`); - andThen(() => { - assert.equal(this.get('value'), `hello world.\n\n----------\n\n\n----------\n`); - assert.equal(textarea.selectionStart, 38); - assert.equal(textarea.selectionEnd, 38); - }); -}); - -testCase(`rule with a selection`, function(assert, textarea) { - textarea.selectionStart = 6; - textarea.selectionEnd = 11; - - click(`button.rule`); - andThen(() => { - assert.equal(this.get('value'), `hello \n\n----------\n.`); - assert.equal(textarea.selectionStart, 19); - assert.equal(textarea.selectionEnd, 19); - }); -}); - testCase(`doesn't jump to bottom with long text`, function(assert, textarea) { let longText = 'hello world.';