Skip to content

Commit

Permalink
IE has a problem with setATtribute('style') this is workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
rondale-sc authored and mixonic committed May 7, 2019
1 parent 1c7f64b commit 5831316
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/js/renderers/editor-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/editor-post-editor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 5831316

Please sign in to comment.