Skip to content

Commit

Permalink
FIX: fails gracefully if :scope is not handled by a browser (#9529)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaffeux committed Apr 23, 2020
1 parent 7a2e8d3 commit be1b7f7
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -113,9 +113,15 @@ export default {
return;
}

const commands = postElements[0].querySelectorAll(
":scope > pre > code, :scope :not(article):not(blockquote) > pre > code"
);
let commands = [];
try {
commands = postElements[0].querySelectorAll(
":scope > pre > code, :scope :not(article):not(blockquote) > pre > code"
);
} catch (e) {
// :scope is probably not supported by this browser
commands = [];
}

const post = helper.getModel();

Expand Down

0 comments on commit be1b7f7

Please sign in to comment.