temporary file hack borked on Windows; working on parsing tag modifiers _properly_

This commit is contained in:
steve donovan 2016-06-27 19:45:26 +02:00
parent d47c0f89bf
commit b903eb79df
2 changed files with 6 additions and 2 deletions

View File

@ -774,7 +774,7 @@ end
local builtin_style, builtin_template = match_bang(args.style),match_bang(args.template)
if builtin_style or builtin_template then
-- '!' 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)
if not path.isdir(tmpdir) then
lfs.mkdir(tmpdir)

View File

@ -537,13 +537,17 @@ function Item.check_tag(tags,tag, value, modifiers)
if avalue then value = avalue..' '..value end
if amod then
modifiers = modifiers or {}
local value_tokens = utils.split(value)
for m,v in pairs(amod) do
local idx = v:match('^%$(%d+)')
local idx = tonumber(v:match('^%$(%d+)'))
if idx then
v, value = value:match('(%S+)(.*)')
-- v = value_tokens[idx]
-- value_tokens[idx] = ''
end
modifiers[m] = v
end
-- value = table.concat(value_tokens, ' ')
end
else -- has to be a function that at least returns tag, value
return alias(tags,value,modifiers)