mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-23 06:13:38 -04:00
Fixed JavaScript and CSS evaluation on instant loading
This commit is contained in:
@@ -64,7 +64,7 @@ let lang: Record<string, string>
|
||||
export function translate(key: TranslateKey, value?: string): string {
|
||||
if (typeof lang === "undefined") {
|
||||
const el = getElementOrThrow("#__lang")
|
||||
lang = JSON.parse(el.innerText)
|
||||
lang = JSON.parse(el.textContent!)
|
||||
}
|
||||
if (typeof lang[key] === "undefined") {
|
||||
throw new ReferenceError(`Invalid translation: ${key}`)
|
||||
|
||||
Reference in New Issue
Block a user