Differences From
Artifact [586a17ee3f]:
34 34 str = str:gsub('%s+[\n$]','')
35 35 str = str:gsub('\n','')
36 36 str = str:gsub('</a><a ','</a> <a ') -- keep nav links from getting smooshed
37 37 str = str:gsub(tplchar .. '%?([-%w]+)', function(file)
38 38 if not docs[file] then docs[file] = data.doc[file] end
39 39 return string.format('<a href="#help-%s" class="help">?</a>', file)
40 40 end)
41 - for start, mode, key, stop in string.gmatch(str,'()'..tplchar..'([:!]?)(%w+)()') do
41 + for start, mode, key, stop in string.gmatch(str,'()'..tplchar..'([:!]?)([-a-zA-Z0-9_]+)()') do
42 42 if string.sub(str,start-1,start-1) ~= '\\' then
43 43 segs[#segs+1] = string.sub(str,last,start-1)
44 - fields[#segs] = { key = key, mode = (mode ~= '' and mode or nil) }
44 + fields[#segs] = { key = key:gsub('-','_'), mode = (mode ~= '' and mode or nil) }
45 45 last = stop
46 46 end
47 47 end
48 48 segs[#segs+1] = string.sub(str,last)
49 49
50 50 for i, s in ipairs(segs) do
51 51 segs[i] = string.gsub(s, '\\'..tplchar, tplchar_o)