Skip to content
Snippets Groups Projects
Commit 1fa9f3c2 authored by Sertonix's avatar Sertonix
Browse files

genhelp.lua: don't match underscores in the middle of words

Fixes help of mkndx and fetch which printed PKGNAMESPEC_ in the help
output. This also matches the behaviour of scdoc.
parent 1d4ed552
No related branches found
No related tags found
No related merge requests found
Pipeline #295222 passed
......@@ -138,8 +138,10 @@ function scdoc:parse_default(ln)
-- Handle formatting
ln = ln:gsub("([^\\])%*(.-[^\\])%*", "%1%2")
ln = ln:gsub("^%*(.-[^\\])%*", "%1")
ln = ln:gsub("([^\\])_(.-[^\\])_", function(a,s) return a..s:upper() end)
ln = ln:gsub("^_(.-[^\\])_", function(s) return s:upper() end)
ln = ln:gsub("([^\\a-zA-Z0-9])_(.-[^\\])_([^a-zA-Z0-9])", function(a,s,e) return a..s:upper()..e end)
ln = ln:gsub("([^\\a-zA-Z0-9])_(.-[^\\])_$", function(a,s) return a..s:upper() end)
ln = ln:gsub("^_(.-[^\\])_([^a-zA-Z0-9])", function(s,e) return s:upper()..e end)
ln = ln:gsub("^_(.-[^\\])_$", function(s) return s:upper() end)
ln = ln:gsub("\\", "")
self:section_text(ln)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment