From 43ffeea64e686e25807959575d07162bc8bb02b6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 2 Feb 2014 10:08:08 +0100 Subject: sync with Context as of 2014-02-02 --- lualibs-url.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lualibs-url.lua') diff --git a/lualibs-url.lua b/lualibs-url.lua index 7b7910f..7bb7312 100644 --- a/lualibs-url.lua +++ b/lualibs-url.lua @@ -26,6 +26,8 @@ local lpegmatch, lpegpatterns, replacer = lpeg.match, lpeg.patterns, lpeg.replac -- | ___________|____________ | -- / \ / \ | -- urn:example:animal:ferret:nose interpretable as extension +-- +-- also nice: http://url.spec.whatwg.org/ (maybe some day ...) url = url or { } local url = url @@ -43,7 +45,7 @@ local hexdigit = R("09","AF","af") local plus = P("+") local nothing = Cc("") local escapedchar = (percent * C(hexdigit * hexdigit)) / tochar -local escaped = (plus / " ") + escapedchar +local escaped = (plus / " ") + escapedchar -- so no loc://foo++.tex local noslash = P("/") / "" @@ -189,7 +191,11 @@ local function hashed(str) -- not yet ok (/test?test) return s end --- inspect(hashed("template://test")) +-- inspect(hashed("template:///test")) +-- inspect(hashed("template:///test++.whatever")) +-- inspect(hashed("template:///test%2B%2B.whatever")) +-- inspect(hashed("template:///test%x.whatever")) +-- inspect(hashed("tem%2Bplate:///test%x.whatever")) -- Here we assume: -- -- cgit v1.2.3