mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 14:36:59 +02:00
Handle non-standard code blocks gracefully
Prior to this change, Docusaurus would encounter an error when trying to parse a ```SnackPlayer ``` codeblock in Prism.js. These code blocks are unique to the React Native site as of this writing. A proper long term fix would be to handle SnackPlayer properly as we do in the React Native website, but until then let's avoid crashing when we encounter these types of blocks.
This commit is contained in:
parent
469593a55e
commit
f803dcbc8e
1 changed files with 2 additions and 2 deletions
|
@ -256,9 +256,9 @@ const Prism = {
|
|||
|
||||
const strarr = [text];
|
||||
|
||||
const rest = grammar.rest;
|
||||
|
||||
if (rest) {
|
||||
if (grammar && grammar.rest) {
|
||||
const rest = grammar.rest;
|
||||
for (var token in rest) {
|
||||
grammar[token] = rest[token];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue