On 22-1-2011 1:20, Aditya Mahajan wrote:
A simple algorithm with assume that everything following the dot is the
extension, while that is certainly not the case here. We can definitely
restrict the search of extension to the last 10 or so characters of the
url, but there will be cases when such heuristics will fail.
it's not that complicated ... say that you patch this way:
function schemes.cleanname(specification)
return (gsub(specification.original,"[^%a%d%.]+","-"))
end
local function fetch(specification)
local original = specification.original
local scheme = specification.scheme
local cleanname = schemes.cleanname(specification)
that will be the current method. Now you can experiment with:
\startluacode
function resolvers.schemes.cleanname(specification)
local name = specification.original
local hash =
file.addsuffix(md5.hex(name),file.suffix(specification.path))
logs.simple("%s => %s",name,hash)
return hash
end
\stopluacode
Just see how that works out
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________