Skip to content

Commit

Permalink
fix: use innerHTML to set style to avoid <br> (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz authored Feb 10, 2022
1 parent ca3a599 commit cbc1497
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,12 @@ async function _embed(
}

if (opts.defaultStyle !== false) {
// Add a default stylesheet to the head of the document.
const ID = 'vega-embed-style';
const {root, rootContainer} = getRoot(element);
if (!root.getElementById(ID)) {
const style = document.createElement('style');
style.id = ID;
style.innerText =
style.innerHTML =
opts.defaultStyle === undefined || opts.defaultStyle === true
? (embedStyle ?? '').toString()
: opts.defaultStyle;
Expand Down

0 comments on commit cbc1497

Please sign in to comment.