Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd1987c9b3 | ||
|
|
85a306296f | ||
|
|
2b9c7635d3 |
@@ -18,6 +18,11 @@
|
||||
/* Links stay quiet — mostly text color with a hint of the accent —
|
||||
and light up to the full accent on hover. */
|
||||
--link: color-mix(var(--text) 50%, var(--accent));
|
||||
/* Inline code tint in body paragraphs: halfway between text and muted.
|
||||
Both endpoints are theme constants, so the mix is a definite color
|
||||
per theme — themes may also pin it outright. Outside paragraphs code
|
||||
inherits the context's color (accent headings stay accent). */
|
||||
--code-inline: color-mix(var(--text), var(--muted));
|
||||
/* Selection fill for page text and the CodeMirror editors; themes
|
||||
override when the accent tint clashes with accent-colored text. */
|
||||
--selection-bg: color-mix(var(--accent) 30%, transparent);
|
||||
@@ -1174,8 +1179,19 @@ code {
|
||||
inherited value), shifting it 30% toward --muted. */
|
||||
code:not(pre code) {
|
||||
padding-inline: 0.2em;
|
||||
word-break: keep-all;
|
||||
color: color-mix(currentColor 70%, var(--muted));
|
||||
/* Never break inside a code span. word-break: keep-all would not
|
||||
suffice: a hard hyphen is an explicit break opportunity (UAX #14),
|
||||
which keep-all does not suppress — `--arg` could still split after
|
||||
the dashes. Inline code is short, so nowrap is safe here. */
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* In body paragraphs the text color is a known constant (--text), so
|
||||
code can take a fixed tint (--code-inline) instead of an unreliable
|
||||
mix off the inherited color. A paragraph never wraps pre, so no guard
|
||||
is needed here. */
|
||||
p code {
|
||||
color: var(--code-inline);
|
||||
}
|
||||
|
||||
code:not(pre code):first-child {
|
||||
|
||||
@@ -180,7 +180,13 @@ def _unwrap_lone_figures(state) -> None:
|
||||
for i, token in enumerate(tokens):
|
||||
if token.type != "inline" or not token.children:
|
||||
continue
|
||||
[child] = token.children if len(token.children) == 1 else [None]
|
||||
# Attrs consumed out of the text (e.g. {style=...} space-separated
|
||||
# on the image's own line) leave empty text tokens behind — strip
|
||||
# them so the lone-image check is not thrown off by user styling.
|
||||
children = [c for c in token.children if c.type != "text" or c.content]
|
||||
if children:
|
||||
token.children = children
|
||||
[child] = children if len(children) == 1 else [None]
|
||||
if child and child.type == "image":
|
||||
if (
|
||||
tokens[i - 1].type == "paragraph_open"
|
||||
|
||||
Reference in New Issue
Block a user