@@ -242,13 +242,13 @@ function createHTML(options = {}) {
242
242
italic: { state: function() { return queryCommandState('italic'); }, result: function() { return exec('italic'); }},
243
243
underline: { state: function() { return queryCommandState('underline'); }, result: function() { return exec('underline'); }},
244
244
strikeThrough: { state: function() { return queryCommandState('strikeThrough'); }, result: function() { return exec('strikeThrough'); }},
245
- heading1: { result: function() { return exec(formatBlock, '<h1>'); }},
246
- heading2: { result: function() { return exec(formatBlock, '<h2>'); }},
247
- heading3: { result: function() { return exec(formatBlock, '<h3>'); }},
248
- heading4: { result: function() { return exec(formatBlock, '<h4>'); }},
249
- heading5: { result: function() { return exec(formatBlock, '<h5>'); }},
250
- heading6: { result: function() { return exec(formatBlock, '<h6>'); }},
251
- paragraph: { result: function() { return exec(formatBlock, '<p>'); }},
245
+ heading1: { state: function() { return queryCommandState(formatBlock) === 'h1'; }, result: function() { return exec(formatBlock, '<h1>'); }},
246
+ heading2: { state: function() { return queryCommandState(formatBlock) === 'h2'; }, result: function() { return exec(formatBlock, '<h2>'); }},
247
+ heading3: { state: function() { return queryCommandState(formatBlock) === 'h3'; }, result: function() { return exec(formatBlock, '<h3>'); }},
248
+ heading4: { state: function() { return queryCommandState(formatBlock) === 'h4'; }, result: function() { return exec(formatBlock, '<h4>'); }},
249
+ heading5: { state: function() { return queryCommandState(formatBlock) === 'h5'; }, result: function() { return exec(formatBlock, '<h5>'); }},
250
+ heading6: { state: function() { return queryCommandState(formatBlock) === 'h6'; }, result: function() { return exec(formatBlock, '<h6>'); }},
251
+ paragraph: { state: function() { return queryCommandState(formatBlock) === 'p'; }, result: function() { return exec(formatBlock, '<p>'); }},
252
252
quote: { result: function() { return exec(formatBlock, '<blockquote>'); }},
253
253
removeFormat: { result: function() { return exec('removeFormat'); }},
254
254
orderedList: {
0 commit comments