aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_help_html.lua
diff options
context:
space:
mode:
authorChris DeLuca <637174+bronzehedwick@users.noreply.github.com>2023-01-04 10:15:08 -0500
committerGitHub <noreply@github.com>2023-01-04 07:15:08 -0800
commit1bd6e4469bb84bb49b342c10d9aa14ffd5f01187 (patch)
treefedc988bfa792bf75fc4e9591612a70b4a460de9 /scripts/gen_help_html.lua
parente35b9020b16985eee26e942f9a3f6b045bc3809b (diff)
downloadrneovim-1bd6e4469bb84bb49b342c10d9aa14ffd5f01187.tar.gz
rneovim-1bd6e4469bb84bb49b342c10d9aa14ffd5f01187.tar.bz2
rneovim-1bd6e4469bb84bb49b342c10d9aa14ffd5f01187.zip
docs(website): soft wrap code blocks #21644
Use `white-space: pre-wrap` to preserve white space as per `pre`, but to allow line wrapping if the display runs out of horizontal space. This prevents lines overflowing their box, and causing horizontal scrolling across the entire page on small screens. This `pre-wrap` technique is used by GitHub to format code for mobile. See https://developer.mozilla.org/en-US/docs/Web/CSS/white-space#pre-wrap
Diffstat (limited to 'scripts/gen_help_html.lua')
-rw-r--r--scripts/gen_help_html.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 4f42633c57..fa7c14eaa3 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -961,7 +961,7 @@ local function gen_css(fname)
pre {
/* Tabs are used in codeblocks only for indentation, not alignment, so we can aggressively shrink them. */
tab-size: 2;
- white-space: pre;
+ white-space: pre-wrap;
line-height: 1.3; /* Important for ascii art. */
overflow: visible;
/* font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; */