diff --git a/src/js/renderers/editor-dom.js b/src/js/renderers/editor-dom.js index 0bc571717..5888493a7 100644 --- a/src/js/renderers/editor-dom.js +++ b/src/js/renderers/editor-dom.js @@ -35,7 +35,7 @@ function handleMarkupSectionAttribute(element, attributeKey, attributeValue) { assert(`cannot use attribute: ${attributeKey}`, _isValidAttribute(attributeKey)); /* This'll work for now, but in the future should be fleshed out */ - element.setAttribute('style', `${attributeKey.replace('data-md-','')}: ${attributeValue}`); + element.style.setProperty(attributeKey.replace('data-md-',''), attributeValue); } function createElementFromMarkup(doc, markup) { diff --git a/tests/acceptance/editor-post-editor-test.js b/tests/acceptance/editor-post-editor-test.js index aaaeb5f51..4d59c2dd0 100644 --- a/tests/acceptance/editor-post-editor-test.js +++ b/tests/acceptance/editor-post-editor-test.js @@ -42,7 +42,7 @@ test('markup sections may contain attributes', (assert) => { editor = new Editor({mobiledoc}); editor.render(editorElement); - assert.hasElement('#editor p[style="text-align: center"]'); + assert.hasElement('#editor p[style="text-align: center;"]'); }); test('#insertSection inserts after the cursor active section', (assert) => {