feat(templates):新增 Markdown 内容页支持
新增 template: content:构建期使用 markdown-it 将本地Markdown 渲染为 HTML(禁用 raw HTML/图片),并按MeNav的URLscheme白名单策略对链接做安全降级
This commit is contained in:
194
assets/style.css
194
assets/style.css
@@ -3324,3 +3324,197 @@ body .content.expanded {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------
|
||||
Markdown Content Styling (GitHub-like) - Scoped to .content-page
|
||||
------------------------------------------------------------------ */
|
||||
|
||||
.content-page {
|
||||
font-family: var(
|
||||
--font-body,
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
'Segoe UI',
|
||||
'Noto Sans',
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif,
|
||||
'Apple Color Emoji',
|
||||
'Segoe UI Emoji'
|
||||
);
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
color: var(--text-color);
|
||||
word-wrap: break-word;
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
|
||||
.content-page h1,
|
||||
.content-page h2,
|
||||
.content-page h3,
|
||||
.content-page h4,
|
||||
.content-page h5,
|
||||
.content-page h6 {
|
||||
margin-top: 24px;
|
||||
margin-bottom: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
.content-page h1 {
|
||||
font-size: 2em;
|
||||
padding-bottom: 0.3em;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.content-page h2 {
|
||||
font-size: 1.5em;
|
||||
padding-bottom: 0.3em;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.content-page h3 {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.content-page h4 {
|
||||
font-size: 1em;
|
||||
}
|
||||
.content-page h5 {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
.content-page h6 {
|
||||
font-size: 0.85em;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.content-page p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.content-page blockquote {
|
||||
margin: 0 0 16px;
|
||||
padding: 0 1em;
|
||||
color: var(--text-muted);
|
||||
border-left: 0.25em solid var(--border-color);
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.content-page ul,
|
||||
.content-page ol {
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
.content-page li + li {
|
||||
margin-top: 0.25em;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
.content-page code {
|
||||
font-family:
|
||||
ui-monospace,
|
||||
SFMono-Regular,
|
||||
SF Mono,
|
||||
Menlo,
|
||||
Consolas,
|
||||
Liberation Mono,
|
||||
monospace;
|
||||
font-size: 85%;
|
||||
padding: 0.2em 0.4em;
|
||||
margin: 0;
|
||||
border-radius: var(--radius-sm);
|
||||
background-color: rgba(127, 127, 127, 0.15);
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
/* Block code (pre) */
|
||||
.content-page pre {
|
||||
padding: 16px;
|
||||
overflow: auto;
|
||||
font-size: 85%;
|
||||
line-height: 1.45;
|
||||
background-color: rgba(var(--card-bg-rgb), 0.5);
|
||||
border-radius: var(--radius-md);
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.content-page pre code {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
font-size: 100%;
|
||||
color: inherit;
|
||||
word-break: normal;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.content-page hr {
|
||||
height: 0.25em;
|
||||
padding: 0;
|
||||
margin: 24px 0;
|
||||
background-color: var(--border-color);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
.content-page table {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
display: block;
|
||||
width: max-content;
|
||||
max-width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.content-page table th,
|
||||
.content-page table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.content-page table th {
|
||||
font-weight: 600;
|
||||
background-color: rgba(var(--card-bg-rgb), 0.3);
|
||||
}
|
||||
|
||||
.content-page table tr {
|
||||
background-color: transparent;
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.content-page table tr:nth-child(2n) {
|
||||
background-color: rgba(127, 127, 127, 0.04);
|
||||
}
|
||||
|
||||
.content-page img {
|
||||
max-width: 100%;
|
||||
box-sizing: content-box;
|
||||
background-color: transparent;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.content-page a {
|
||||
color: var(--accent-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.content-page a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Task lists */
|
||||
.content-page ul.contains-task-list {
|
||||
list-style-type: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.content-page .task-list-item input {
|
||||
margin-right: 0.5em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user