aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-10-01 12:51:16 +0200
committerJustin M. Keyes <justinkz@gmail.com>2024-10-01 12:51:16 +0200
commit72892aab066a58524d670777512e9cab45e7310d (patch)
treeffa471b7bb3f6c8f1ca0105ac15d5fa7cadb87b8
parenta0c64fe816f82010dea43d8bbe25475fbabfb562 (diff)
downloadrneovim-72892aab066a58524d670777512e9cab45e7310d.tar.gz
rneovim-72892aab066a58524d670777512e9cab45e7310d.tar.bz2
rneovim-72892aab066a58524d670777512e9cab45e7310d.zip
docs(gen_help_html.lua): h4 pseudo-heading layout
Problem: The <br> hack in a0c64fe816f8 causes weird layout if a "h4 pseudo-heading" is not the only tag on the line. For example in the help text below, the "*'buflisted'*" tag was treated as h4 and followed by <br>, which is obviously wrong: *'buflisted'* *'bl'* *'nobuflisted'* *'nobl'* *E85* 'buflisted' 'bl' boolean (default on) Solution: Only treat a tag as "h4 pseudo-heading" if it is the only tag in the line. This is fragile, but in practice seems to get the right balance.
-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 20aeb2791e..f6e799508b 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -670,7 +670,7 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
return text
end
local in_heading = vim.list_contains({ 'h1', 'h2', 'h3' }, parent)
- local h4 = (not in_heading and get_indent(node_text()) > 8)
+ local h4 = not in_heading and not next_ and get_indent(node_text()) > 8 -- h4 pseudo-heading
local cssclass = h4 and 'help-tag-right' or 'help-tag'
local tagname = node_text(root:child(1), false)
if vim.tbl_count(stats.first_tags) < 2 then