Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib/MarkdownViewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2927,13 +2927,13 @@ import { t } from './utils/i18n.js';
.markdown-body {
box-sizing: border-box;
min-width: 200px;
margin: 0;
margin: 0 auto;
padding: 50px clamp(24px, 5vw, 50px);
height: 100%;
overflow-y: auto;
overflow-x: hidden;
transform: translate3d(0, 0, 0);
max-width: 100%;
max-width: 880px;
text-align: left;
overflow-wrap: anywhere;
}
Expand Down Expand Up @@ -2989,8 +2989,8 @@ import { t } from './utils/i18n.js';
}

.markdown-body.full-width {
padding: 50px clamp(24px, 5vw, 50px);
max-width: 100%;
margin: 0;
}


Expand Down
7 changes: 5 additions & 2 deletions src/lib/components/FindBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@

function isHostElement(el: Element | null): boolean {
if (!el) return false;
// Skip elements whose text is not user-visible (script/style/noscript)
// and our own find marks (to avoid re-walking already-highlighted text).
// CODE and PRE intentionally NOT skipped: code blocks contain real
// content the user expects to be searchable, even when highlight.js
// has wrapped tokens in nested <span>s.
const tag = el.tagName;
return (
tag === 'CODE' ||
tag === 'PRE' ||
tag === 'SCRIPT' ||
tag === 'STYLE' ||
tag === 'NOSCRIPT' ||
Expand Down
43 changes: 38 additions & 5 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,11 @@ body {
.title-action-btn,
.theme-dropdown-container,
.control-btn,
.lang-label {
.lang-label,
.top-fade-mask,
.toc-overlay-wrapper,
.toc-toggle-floating,
.find-bar {
display: none !important;
}

Expand All @@ -1155,7 +1159,8 @@ body {
#app,
.markdown-container,
.layout-container,
.pane.viewer-pane {
.pane.viewer-pane,
.viewer-content {
background: white !important;
overflow: visible !important;
height: auto !important;
Expand All @@ -1179,10 +1184,38 @@ body {
position: static !important;
}

.markdown-body pre {
.markdown-body pre,
.markdown-body pre code {
white-space: pre-wrap !important;
word-break: break-word !important;
overflow-x: visible !important;
overflow-wrap: anywhere !important;
word-break: normal !important;
overflow: visible !important;
}

.markdown-body p,
.markdown-body li {
orphans: 3;
widows: 3;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
break-after: avoid;
break-inside: avoid;
}

.markdown-body pre,
.markdown-body blockquote,
.markdown-body table,
.markdown-body figure,
.markdown-body img,
.markdown-body .mermaid-diagram,
.markdown-body .katex-display {
break-inside: avoid;
}

.markdown-container {
Expand Down