temporary file hack borked on Windows; working on parsing tag modifiers _properly_
This commit is contained in:
parent
d47c0f89bf
commit
b903eb79df
2
ldoc.lua
2
ldoc.lua
|
@ -774,7 +774,7 @@ end
|
||||||
local builtin_style, builtin_template = match_bang(args.style),match_bang(args.template)
|
local builtin_style, builtin_template = match_bang(args.style),match_bang(args.template)
|
||||||
if builtin_style or builtin_template then
|
if builtin_style or builtin_template then
|
||||||
-- '!' here means 'use built-in templates'
|
-- '!' here means 'use built-in templates'
|
||||||
local user = path.expanduser('~'):gsub('[/\\ ]','_')
|
local user = path.expanduser('~'):gsub('[/\\: ]','_')
|
||||||
local tmpdir = path.join(path.is_windows and os.getenv('TMP') or '/tmp','ldoc'..user)
|
local tmpdir = path.join(path.is_windows and os.getenv('TMP') or '/tmp','ldoc'..user)
|
||||||
if not path.isdir(tmpdir) then
|
if not path.isdir(tmpdir) then
|
||||||
lfs.mkdir(tmpdir)
|
lfs.mkdir(tmpdir)
|
||||||
|
|
|
@ -537,13 +537,17 @@ function Item.check_tag(tags,tag, value, modifiers)
|
||||||
if avalue then value = avalue..' '..value end
|
if avalue then value = avalue..' '..value end
|
||||||
if amod then
|
if amod then
|
||||||
modifiers = modifiers or {}
|
modifiers = modifiers or {}
|
||||||
|
local value_tokens = utils.split(value)
|
||||||
for m,v in pairs(amod) do
|
for m,v in pairs(amod) do
|
||||||
local idx = v:match('^%$(%d+)')
|
local idx = tonumber(v:match('^%$(%d+)'))
|
||||||
if idx then
|
if idx then
|
||||||
v, value = value:match('(%S+)(.*)')
|
v, value = value:match('(%S+)(.*)')
|
||||||
|
-- v = value_tokens[idx]
|
||||||
|
-- value_tokens[idx] = ''
|
||||||
end
|
end
|
||||||
modifiers[m] = v
|
modifiers[m] = v
|
||||||
end
|
end
|
||||||
|
-- value = table.concat(value_tokens, ' ')
|
||||||
end
|
end
|
||||||
else -- has to be a function that at least returns tag, value
|
else -- has to be a function that at least returns tag, value
|
||||||
return alias(tags,value,modifiers)
|
return alias(tags,value,modifiers)
|
||||||
|
|
Loading…
Reference in New Issue