Skip to content

Commit f54ffb6

Browse files
committed
fix(mdviewer): prefer specific list items and force light theme
- Use >= instead of > in data-source-line search so child elements (li) override their parent containers (ul/ol) with the same line number - Force light theme in md viewer for paper-like appearance regardless of editor theme (infrastructure preserved for future dark mode support)
1 parent ce0880d commit f54ffb6

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src-mdviewer/src/bridge.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,12 @@ function handleReloadFile(data) {
799799

800800
function handleSetTheme(data) {
801801
const { theme } = data;
802-
document.documentElement.setAttribute("data-theme", theme);
803-
if (theme === "dark") {
804-
document.documentElement.style.colorScheme = "dark";
805-
} else {
806-
document.documentElement.style.colorScheme = "light";
807-
}
808-
setState({ theme });
802+
// Force light theme for a paper-like appearance regardless of editor theme.
803+
// The theme infrastructure is preserved for future use.
804+
const appliedTheme = "light";
805+
document.documentElement.setAttribute("data-theme", appliedTheme);
806+
document.documentElement.style.colorScheme = "light";
807+
setState({ theme: appliedTheme });
809808
}
810809

811810
function handleSetEditMode(data) {
@@ -994,7 +993,7 @@ function handleScrollToLine(data) {
994993
let bestLine = -1;
995994
for (const el of elements) {
996995
const srcLine = parseInt(el.getAttribute("data-source-line"), 10);
997-
if (srcLine <= line && srcLine > bestLine) {
996+
if (srcLine <= line && srcLine >= bestLine) {
998997
bestLine = srcLine;
999998
bestEl = el;
1000999
}

0 commit comments

Comments
 (0)