fix(single): align article code blocks with the reference theme

The article body ran two highlighting pipelines at once: the runtime
EnlighterJS pass (same one the comment area uses) plus a bespoke
precode.js enhancer, and a hand-rolled .code-block skin. The two
disagreed, so rendered blocks carried a dark #282c34 card with 15px
padding, 14px text, a border and a second copy button stacked on top of
the EnlighterJS toolbar.

Drop the parallel path and let one pipeline own code blocks:
- delete precode.js, single-post/code-blocks.css and the unused
  assets/js/enlighter copy that only precode.js referenced
- drop the now-dead has_code requirement (PHP scan + feature enqueue)
- render pre exactly as the reference does: bootstrap's pre box
  (9.5px padding / 13px / radius 4) plus main.css's muted background,
  with the EnlighterJS theme supplying the skin

Also scope the inline-code skin to :not(pre code) so it stops painting
the block background pink, and remap the toolbar copy glyph: \f0ea is
the clipboard in FA4 but "paste" in FA5; the clipboard is \f328.

Verified against the reference at 1440px both themes: pre 13px/18.57,
9.5px padding, radius 4, muted background; EnlighterJS block heights
151.31 / 60.38 match exactly.
This commit is contained in:
kate522 committed 2026-11-03 23:31:28 +08:00
1 parent ba32e0ef9c
commit 8ad5ef9aff
19 files changed
+112 -430

No files matched your search

+3 -1
View File
@@ -67,12 +67,14 @@
background: rgba(57, 60, 66, 0.87)
}
/* 字形码位随 FA5 重新映射:旧版 \f0ea 在 FA4 是剪贴板,FA5 里同码位变成
* 粘贴,剪贴板移到 \f328。其余两个码位在 FA5 中保持同名。 */
.enlighter-default .enlighter-toolbar .enlighter-btn-raw::after {
content: "\f121"
}
.enlighter-default .enlighter-toolbar .enlighter-btn-copy::after {
content: "\f0ea"
content: "\f328"
}
.enlighter-default .enlighter-toolbar .enlighter-btn-window::after {