mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix problem with missing syntax highlighting languages causing runtime crash on the website (#12781)
* Fix problem with universe pages using `docker` language * Fix problem with universe pages using `r` language * Add fallback, in case code language is unknown
This commit is contained in:
parent
57a230c6e4
commit
bd239511a4
|
@ -13,6 +13,8 @@ import 'prismjs/components/prism-json.min.js'
|
||||||
import 'prismjs/components/prism-markdown.min.js'
|
import 'prismjs/components/prism-markdown.min.js'
|
||||||
import 'prismjs/components/prism-python.min.js'
|
import 'prismjs/components/prism-python.min.js'
|
||||||
import 'prismjs/components/prism-yaml.min.js'
|
import 'prismjs/components/prism-yaml.min.js'
|
||||||
|
import 'prismjs/components/prism-docker.min.js'
|
||||||
|
import 'prismjs/components/prism-r.min.js'
|
||||||
|
|
||||||
import { isString } from './util'
|
import { isString } from './util'
|
||||||
import Link, { OptionalLink } from './link'
|
import Link, { OptionalLink } from './link'
|
||||||
|
@ -172,7 +174,7 @@ const convertLine = ({ line, prompt, lang }) => {
|
||||||
return handlePromot({ lineFlat, prompt })
|
return handlePromot({ lineFlat, prompt })
|
||||||
}
|
}
|
||||||
|
|
||||||
return lang === 'none' || !lineFlat ? (
|
return lang === 'none' || !lineFlat || !(lang in Prism.languages) ? (
|
||||||
lineFlat
|
lineFlat
|
||||||
) : (
|
) : (
|
||||||
<span
|
<span
|
||||||
|
|
Loading…
Reference in New Issue
Block a user