Skip to content

Commit 63a9cea

Browse files
committed
fix(markdown): le thème dans l'URL l'emporte sur celui du YAML
1 parent 15503bd commit 63a9cea

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

app/js/markdown/custom/yaml.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { config } from "../../config.mjs";
22
import { load as loadYAML } from "../../lib/js-yaml.mjs";
3-
import { loadScript, loadCSS } from "../../utils/urls.mjs";
3+
import { loadScript, loadCSS, getParamsFromURL } from "../../utils/urls.mjs";
44
import { deepMerge } from "../../utils/objects.mjs";
55
import { setContentOfFooter } from "../../utils/ui.mjs";
66
import { decodeApiKey } from "../../ai/helpers/keyDecoder.mjs";
@@ -164,9 +164,11 @@ export function processYAML(markdownContent) {
164164
if (yaml.darkmode !== false) {
165165
checkDarkModePreference();
166166
}
167-
if (yaml.theme) {
167+
const themeInURL = getParamsFromURL().theme;
168+
if (yaml.theme || themeInURL) {
169+
const themeToApply = themeInURL ? themeInURL : yaml.theme;
168170
// compatiblité avec l'ancien nom pour le thème sms
169-
const themeName = yaml.theme == "bubbles" ? "sms" : yaml.theme;
171+
const themeName = themeToApply == "bubbles" ? "sms" : themeToApply;
170172
const cssFile = themeName.endsWith(".css")
171173
? "css/themes/" + themeName
172174
: "css/themes/" + themeName + ".css";

app/script.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/script.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)