aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_help_html.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2022-12-11 21:41:26 -0500
committerGitHub <noreply@github.com>2022-12-11 18:41:26 -0800
commit1c324cb1927e03b5a3584a8982e3d5029498f14e (patch)
treef28365744a6c2a44eec00194a0e443bf008151f9 /scripts/gen_help_html.lua
parentb12bb97feeb84df47d672d39b2de170061c37f45 (diff)
downloadrneovim-1c324cb1927e03b5a3584a8982e3d5029498f14e.tar.gz
rneovim-1c324cb1927e03b5a3584a8982e3d5029498f14e.tar.bz2
rneovim-1c324cb1927e03b5a3584a8982e3d5029498f14e.zip
docs #20986
- https://github.com/neovim/tree-sitter-vimdoc v1.2.4 eliminates most errors in pi_netrw.txt, so we can remove that workaround from ignore_parse_error(). - improved codeblock
Diffstat (limited to 'scripts/gen_help_html.lua')
-rw-r--r--scripts/gen_help_html.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 3a0ed5ffc5..78fb917764 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -296,12 +296,11 @@ local function ignore_invalid(s)
)
end
-local function ignore_parse_error(s, fname)
- local helpfile = vim.fs.basename(fname)
- return (helpfile == 'pi_netrw.txt'
+local function ignore_parse_error(s)
+ return (
-- Ignore parse errors for unclosed tag.
-- This is common in vimdocs and is treated as plaintext by :help.
- or s:find("^[`'|*]")
+ s:find("^[`'|*]")
)
end
@@ -370,7 +369,7 @@ local function visit_validate(root, level, lang_tree, opt, stats)
end
if node_name == 'ERROR' then
- if ignore_parse_error(text, opt.fname) then
+ if ignore_parse_error(text) then
return
end
-- Store the raw text to give context to the error report.
@@ -582,7 +581,7 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
end
return s
elseif node_name == 'ERROR' then
- if ignore_parse_error(trimmed, opt.fname) then
+ if ignore_parse_error(trimmed) then
return text
end