]> Repositorios git - classgraph.git/commit
Render Haddock markup in the side panel
authorJavier Sagredo <[email protected]>
Thu, 7 May 2026 01:16:37 +0000 (03:16 +0200)
committerJavier Sagredo <[email protected]>
Thu, 7 May 2026 01:16:37 +0000 (03:16 +0200)
commite844a180d639d865d8bf15624c7fb85dbe1aaabb
treeb9421a2f63f19faee08c804e2d507808bb1eb903
parent8a53ac2f7263ec5b3d49879347b669f63d4094d7
Render Haddock markup in the side panel

Replace the plain-text rendering of class / instance / family /
fam-instance docstrings with a small markup-aware renderer that
covers the common Haddock constructs:

* @code@ → inline <code>
* 'Foo' / 'Foo.bar' / 'Mod.Foo.bar' → <code>Foo[…]</code>
  (only when the content has identifier shape; English contractions
  like "don't" are left alone)
* "Module.Name" → <code>Module.Name</code>
* __bold__ → <strong>
* /italic/ → <em> (with surrounding-punct check so URLs and Haskell
  operators like /= aren't mangled)
* [text](url) → <a href>
* `> code` bird-foot blocks → <pre>

No new dependencies — six regex passes in a couple of dozen lines
of JS. Anything we don't recognise renders as plain text (visible
@ / quotes), which is mildly ugly but never wrong. CSS gives
inline code an amber tag styling, code blocks a soft-amber box.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
data/viewer.css
data/viewer.js