Skip to content

Commit

Permalink
fix: use Array.from instead of slice.call to convert querySelectorAll…
Browse files Browse the repository at this point in the history
… output to Array
  • Loading branch information
aminya committed Oct 12, 2020
1 parent 678b1b4 commit 0527bc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function highlightCodeFragments(domFragment: HTMLElement, grammar: string)
})
}

const elements: HTMLPreElement[] = [].slice.call(domFragment.querySelectorAll("pre"))
const elements: HTMLPreElement[] = Array.from(domFragment.querySelectorAll("pre"))
const promises = elements.map(async (preElement) => {
let codeBlock = preElement.firstElementChild ?? preElement
let fenceName =
Expand Down

0 comments on commit 0527bc6

Please sign in to comment.