Fetch directly from patched path if language is patched
This commit is contained in:
parent
7c3d4b6f86
commit
05e587b018
3 changed files with 8 additions and 6 deletions
|
@ -36,7 +36,7 @@
|
||||||
<div id="length">Waiting...</div>
|
<div id="length">Waiting...</div>
|
||||||
|
|
||||||
<div id="info">
|
<div id="info">
|
||||||
v2.2.1 | © Nicd 2023 | <a href="https://gitlab.com/Nicd/t" target="_blank">Source</a> | <a href="./licenses.txt"
|
v2.2.2 | © Nicd 2023 | <a href="https://gitlab.com/Nicd/t" target="_blank">Source</a> | <a href="./licenses.txt"
|
||||||
target="_blank">Licenses</a>
|
target="_blank">Licenses</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -311,6 +311,7 @@ for (let i = 0; i < LANGUAGE_NAMES.length; ++i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PLAINTEXT = LANGUAGE_NAMES[0];
|
export const PLAINTEXT = LANGUAGE_NAMES[0];
|
||||||
|
export const PATCHED_LANGUAGES = new Set(["gleam"]);
|
||||||
|
|
||||||
export async function getDepsData() {
|
export async function getDepsData() {
|
||||||
const resp = await fetch("./vendor/prism/components.json");
|
const resp = await fetch("./vendor/prism/components.json");
|
||||||
|
|
|
@ -17,6 +17,7 @@ import {
|
||||||
LANGUAGES,
|
LANGUAGES,
|
||||||
LANGUAGE_NAMES,
|
LANGUAGE_NAMES,
|
||||||
PLAINTEXT,
|
PLAINTEXT,
|
||||||
|
PATCHED_LANGUAGES,
|
||||||
} from "./languages.js";
|
} from "./languages.js";
|
||||||
|
|
||||||
const PROJECT_NAME = "Tahnaroskakori";
|
const PROJECT_NAME = "Tahnaroskakori";
|
||||||
|
@ -105,11 +106,11 @@ async function highlightLanguage() {
|
||||||
dataOptions.language
|
dataOptions.language
|
||||||
);
|
);
|
||||||
for (const dep of [...deps, dataOptions.language]) {
|
for (const dep of [...deps, dataOptions.language]) {
|
||||||
try {
|
const importPath = PATCHED_LANGUAGES.has(dep)
|
||||||
await import(`./vendor/prism/components/prism-${dep}.js`);
|
? `./vendor/prism-patches/prism-${dep}.js`
|
||||||
} catch {
|
: `./vendor/prism/components/prism-${dep}.js`;
|
||||||
await import(`./vendor/prism-patches/prism-${dep}.js`);
|
|
||||||
}
|
await import(importPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewMode === ViewMode.VIEW) {
|
if (viewMode === ViewMode.VIEW) {
|
||||||
|
|
Loading…
Reference in a new issue