diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-02 01:10:08 -0800 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-02 01:10:08 -0800 |
commit | d758aba692b362c8653e1e4b1b5c13df4346652b (patch) | |
tree | 85352d4c1c48f6df474ff9f330cf7207f726d1a5 /lualibs-url.lua | |
parent | 954d59d0e7c66cbeb72c9d323706dafdd7ac3a5b (diff) | |
parent | 43ffeea64e686e25807959575d07162bc8bb02b6 (diff) | |
download | lualibs-d758aba692b362c8653e1e4b1b5c13df4346652b.tar.gz |
Merge pull request #23 from phi-gamma/master
sync with Context
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: -- |