aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_help_html.lua
diff options
context:
space:
mode:
authorJongwook Choi <wookayin@gmail.com>2024-05-15 21:53:14 -0400
committerChristian Clason <c.clason@uni-graz.at>2024-05-17 08:18:01 +0200
commit878dcf19807ad880fadac200b65619e237492460 (patch)
tree790dd07a823d6f24d2ddc0545117b2ad7e697b11 /scripts/gen_help_html.lua
parent06135cc21571b2707121e31176f544a0e0901e1d (diff)
downloadrneovim-878dcf19807ad880fadac200b65619e237492460.tar.gz
rneovim-878dcf19807ad880fadac200b65619e237492460.tar.bz2
rneovim-878dcf19807ad880fadac200b65619e237492460.zip
docs(gen_help_html.lua): handle modeline and note nodes
Problem: 'modeline' and 'note' are unhandled in the online HTML documentation. Some (not all) modelines are parsed by the vimdoc parser as a node of type 'modeline'. Solution: - Ignore 'modeline' in HTML rendering. - Render 'note' text in boldface.
Diffstat (limited to 'scripts/gen_help_html.lua')
-rw-r--r--scripts/gen_help_html.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index b33a94dca5..b712cf1475 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -532,6 +532,8 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
return ('%s<a href="%s">%s</a>%s'):format(ws(), fixed_url, fixed_url, removed_chars)
elseif node_name == 'word' or node_name == 'uppercase_name' then
return text
+ elseif node_name == 'note' then
+ return ('<b>%s</b>'):format(text)
elseif node_name == 'h1' or node_name == 'h2' or node_name == 'h3' then
if is_noise(text, stats.noise_lines) then
return '' -- Discard common "noise" lines.
@@ -694,6 +696,8 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
return string.format('%s</span>', s)
end
return s
+ elseif node_name == 'modeline' then
+ return ''
elseif node_name == 'ERROR' then
if ignore_parse_error(opt.fname, trimmed) then
return text