Skip to content

Commit dd966c3

Browse files
committed
chore: update AGENTS.md to clarify hljs-clipboard.js loads in server mode
1 parent 6023c69 commit dd966c3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Two highlighting modes:
66

77
- **Client-side** (default): Prism.js runs in the browser. Loads the Prism JS bundle + theme CSS.
8-
- **Server-side**: highlight.php pre-renders token spans on the server. No JS loaded. Uses the same Prism theme CSS — token class remapping (`remap_token_classes()` in `class-blocks.php`) converts hljs-* span classes to Prism `token *` classes via `strtr`, giving exact visual parity across all 21 themes.
8+
- **Server-side**: highlight.php pre-renders token spans on the server. Loads only `hljs-clipboard.js` for the copy-to-clipboard and expand/collapse toolbar buttons (no Prism JS). Uses the same Prism theme CSS — token class remapping (`remap_token_classes()` in `class-blocks.php`) converts hljs-* span classes to Prism `token *` classes via `strtr`, giving exact visual parity across all 21 themes.
99

1010
## Commands
1111

@@ -35,7 +35,7 @@ Key files:
3535

3636
- `includes/class-main.php` — bootstrap and object wiring
3737
- `includes/frontend/class-blocks.php` — editor assets, REST route, `render_block_core/code` filter; `render_code_block_server()` for server mode; `remap_token_classes()` for hljs→Prism class mapping
38-
- `includes/frontend/class-styles-handler.php` — conditional asset loading for both modes: client (Prism JS + theme CSS) and server (theme CSS + `hljs-server-mode.css`, no JS)
38+
- `includes/frontend/class-styles-handler.php` — conditional asset loading for both modes: client (Prism JS + theme CSS) and server (theme CSS + `hljs-server-mode.css` + `hljs-clipboard.js`)
3939
- `includes/admin/class-settings.php` — settings registration; `get_color_scheme_css()` always returns Prism CSS URL (no per-mode branch)
4040
- `includes/blocks/src/js/index.js` — block filter, Inspector Controls
4141
- `includes/blocks/src/js/frontend.js` — Prism grammars + plugins
@@ -67,7 +67,7 @@ Always `require` the generated `.asset.php` manifest before enqueueing block scr
6767
Assets load only on pages containing at least one `core/code` block (`Styles_Handler::enqueue_assets()`). Use `wzcbh_force_load_assets` to override.
6868

6969
- **Client mode**: `frontend.css` + Prism theme CSS + `wzcbh-prism-js` script bundle
70-
- **Server mode**: `frontend.css` + Prism theme CSS + `hljs-server-mode.css` (no JS; syntax already pre-rendered in HTML)
70+
- **Server mode**: `frontend.css` + Prism theme CSS + `hljs-server-mode.css` + `hljs-clipboard.js` (syntax pre-rendered in HTML; `hljs-clipboard.js` provides copy-to-clipboard and expand/collapse only, no Prism)
7171

7272
## Filters and routes
7373

0 commit comments

Comments
 (0)