diff options
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/cgit.css | 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | assets/cgit.js | 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 files changed, 21 insertions, 0 deletions
diff --git a/assets/cgit.css b/assets/cgit.css index 10fcf66..f441faa 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -496,6 +496,24 @@ div#cgit div#summary pre { overflow-x: auto; } +/* A plaintext readme served without an about filter. Wrapped instead of + * scrolled, since prose is the common case. */ +div#cgit pre.plaintext { + white-space: pre-wrap; + overflow-wrap: anywhere; + font-family: var(--font-mono); + line-height: 1.5; + margin: 0; +} + +/* Markdown source before the client-side renderer has run, and for good + * when scripting is off. Keeps the line structure so it reads as text. */ +div#cgit .markdown[data-markdown] { + white-space: pre-wrap; + overflow-wrap: anywhere; + font-family: var(--font-mono); +} + div#cgit .markdown { line-height: 1.6; overflow-wrap: break-word; diff --git a/assets/cgit.js b/assets/cgit.js index 4e0ac70..347e977 100644 --- a/assets/cgit.js +++ b/assets/cgit.js @@ -300,6 +300,9 @@ document.addEventListener("DOMContentLoaded", function () { continue; try { el.innerHTML = render(text); + /* The attribute doubles as the style hook for the + * unrendered source, so drop it once rendered. */ + el.removeAttribute("data-markdown"); } catch (e) { /* leave the escaped source in place on any failure */ } |
