mirror of
https://github.com/discourse/discourse.git
synced 2025-02-01 01:59:46 +08:00
FIX: fails gracefully if :scope is not handled by a browser (#9529)
This commit is contained in:
parent
7a2e8d3ead
commit
be1b7f7468
|
@ -113,9 +113,15 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const commands = postElements[0].querySelectorAll(
|
let commands = [];
|
||||||
|
try {
|
||||||
|
commands = postElements[0].querySelectorAll(
|
||||||
":scope > pre > code, :scope :not(article):not(blockquote) > pre > code"
|
":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();
|
const post = helper.getModel();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user