tenseleyflow/shithub / 7e1f3b6

Browse files

Document README presentation chrome

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
7e1f3b61859abab33fd869677ca420a3970e86d0
Parents
ea2e141
Tree
4adc5a9

1 changed file

StatusFile+-
M docs/internal/markdown.md 18 0
docs/internal/markdown.mdmodified
@@ -161,6 +161,24 @@ viewer-aware visibility — should call `markdown.Render` directly.
161
 The interim `RenderHTML` keeps a sensible default (SoftBreakAsBR
161
 The interim `RenderHTML` keeps a sensible default (SoftBreakAsBR
162
 on, no resolvers).
162
 on, no resolvers).
163
 
163
 
164
+## README presentation chrome
165
+
166
+Repository READMEs use the same sanitized HTML pipeline as comments and
167
+issues. The repo page adds GitHub-parity presentation chrome in the web
168
+layer only:
169
+
170
+- `<pre>` blocks inside `.markdown-body` are wrapped client-side with a
171
+  stable code-block container and a copy button. The copied text comes
172
+  from the original `<code>` or `<pre>` textContent, not from injected
173
+  controls.
174
+- The README outline menu is populated client-side from rendered `h1`-
175
+  `h6` elements. Goldmark-generated IDs are reused. Raw HTML headings
176
+  without IDs get deterministic page-local slugs so the outline can link
177
+  to them.
178
+- The JavaScript only reads sanitized text/IDs and mutates local chrome;
179
+  it is not part of the trust boundary. Sanitization remains entirely in
180
+  `internal/markdown`.
181
+
164
 ## Lint guard
182
 ## Lint guard
165
 
183
 
166
 `scripts/lint-markdown-boundary.sh` fails CI when goldmark or
184
 `scripts/lint-markdown-boundary.sh` fails CI when goldmark or