diff --git a/AGENTS.md b/AGENTS.md index c194d9d..235bf7d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -64,6 +64,13 @@ like `line-numbers` depend on. Without `prism-plugin`, code is rendered via `Pri `hljs.highlight` into `v-html`. Users import plugin JS/CSS themselves and add the plugin class (e.g. `class="line-numbers"`), which is passed through to the `
`.
 
+## Attributes
+
+The component sets `inheritAttrs: false` and places attributes itself: `class` goes on both the
+wrapper and the `
` (wrapper styling plus Prism plugin classes), `style` on the wrapper only, and
+everything else (`id`, `data-*`, `aria-*`, listeners) on the `
` only. Keep `class` duplicated;
+Prism plugins need it on the `
`.
+
 ## Build Process
 
 ```bash
@@ -88,6 +95,18 @@ Tests live in `src/plugin/__tests__/`, `src/plugin/components/__tests__/`, and
 `src/plugin/composables/__tests__/`. Update snapshots with `pnpm vitest --run -u` only when the
 change is intended.
 
+### Test in the playground
+
+Unit tests run in jsdom, which does not cover real rendering, theme CSS, or Prism plugins well.
+After any change to the component's rendering, attributes, styles, themes, or plugins, also check
+it in the browser playground at http://127.0.0.1:3000/vue-code-block/playground/ (served by
+`pnpm dev` / `pnpm play`).
+
+- The playground page is `src/playground/PlaygroundPage.ts.vue`. It is gitignored scratch space
+  (created from `src/playground/configs/templates/` if missing), so edit it freely to set up the
+  case being tested, and restore it afterwards.
+- Check the rendered DOM and the browser console, not just that the page loads.
+
 ## Linting
 
 ```bash
diff --git a/src/plugin/VCodeBlock.vue b/src/plugin/VCodeBlock.vue
index fe2997f..f031aee 100644
--- a/src/plugin/VCodeBlock.vue
+++ b/src/plugin/VCodeBlock.vue
@@ -1,5 +1,8 @@