diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-02 10:08:08 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-02 10:08:08 +0100 |
commit | 43ffeea64e686e25807959575d07162bc8bb02b6 (patch) | |
tree | 85352d4c1c48f6df474ff9f330cf7207f726d1a5 /lualibs-url.lua | |
parent | 7b5039cbb0bd520d89a22b61e42ec94d05a32c2e (diff) | |
download | lualibs-43ffeea64e686e25807959575d07162bc8bb02b6.tar.gz |
sync with Context as of 2014-02-02
Diffstat (limited to 'lualibs-url.lua')
-rw-r--r-- | lualibs-url.lua | 10 |
1 files changed, 8 insertions, 2 deletions
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: -- |