From 187c6bca195be0d65b320d7576dcd1674c3495bd Mon Sep 17 00:00:00 2001 From: Andy Harrison Date: Sat, 12 Mar 2022 00:37:21 -0500 Subject: [PATCH 1/5] fix for mailto parsing --- src/uri_parsing.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uri_parsing.mjs b/src/uri_parsing.mjs index c20dc8d..9c5532a 100644 --- a/src/uri_parsing.mjs +++ b/src/uri_parsing.mjs @@ -321,7 +321,7 @@ URI.schemeParser = { query += "body=" + encodePart(p.body); } if(p.headers.length){ - for(i=0; i Date: Sat, 12 Mar 2022 02:52:40 -0500 Subject: [PATCH 3/5] update jsfiddle demo --- demo/demo.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/demo/demo.js b/demo/demo.js index 0c55ceb..24940ff 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -5,11 +5,10 @@ console.clear(); document.getElementById("parse_scheme").addEventListener("click", ()=>{ let val = document.getElementById("uri").value; console.group("scheme"); - console.log(val); try{ - val = URI(val); - console.log(val.toString()); - console.log(val); + let obj = URI(val); + console.log("--> "+obj.toString()); + console.log(obj); }catch(e){ if(e instanceof URIError) console.error(e.message); else throw e; @@ -21,11 +20,10 @@ document.getElementById("parse_scheme").addEventListener("click", ()=>{ document.getElementById("parse_generic").addEventListener("click", ()=>{ let val = document.getElementById("uri").value; console.group("generic"); - console.log(val); try{ - val = URI.parse(val) - console.log(val.toString()); - console.log(val); + let obj = URI.parse(val) + console.log("--> "+obj.toString()); + console.log(obj); }catch(e){ if(e instanceof URIError) console.error(e.message); else throw e; @@ -37,11 +35,10 @@ document.getElementById("parse_generic").addEventListener("click", ()=>{ document.getElementById("parse_mailbox").addEventListener("click", ()=>{ let val = document.getElementById("email").value; console.group("email"); - console.log(val); try{ - val = parseMailbox(val); - console.log(val.full); - console.log(val); + let obj = parseMailbox(val); + console.log("--> "+obj.toString()); + console.log(obj); }catch(e){ if(e instanceof URIError) console.log(e.message); else throw e; From dfc9d936a08ed78a7376de7dcf722577c716375b Mon Sep 17 00:00:00 2001 From: Andy Harrison Date: Sat, 12 Mar 2022 03:00:39 -0500 Subject: [PATCH 4/5] fix module import --- demo/demo.htm | 2 -- demo/demo.js | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/demo/demo.htm b/demo/demo.htm index e8354a9..93e66c9 100644 --- a/demo/demo.htm +++ b/demo/demo.htm @@ -1,5 +1,3 @@ - -

diff --git a/demo/demo.js b/demo/demo.js index 24940ff..b0c9acc 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -1,6 +1,4 @@ -import URI, {URIError, isDNSDomain, parseMailbox} from "https://cdn.jsdelivr.net/gh/wizard04wsu/URI_Parsing@jsfiddle-demo/src/uri_parsing.js" - -console.clear(); +import URI, {isDNSDomain, parseMailbox} from "https://cdn.jsdelivr.net/gh/wizard04wsu/URI_Parsing@jsfiddle-demo/src/uri_parsing.mjs" document.getElementById("parse_scheme").addEventListener("click", ()=>{ let val = document.getElementById("uri").value; From 8e60673ece1c00358589f0ba3a91f6ffde88d094 Mon Sep 17 00:00:00 2001 From: Andy Harrison Date: Sat, 12 Mar 2022 03:13:41 -0500 Subject: [PATCH 5/5] update link to jsfiddle --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c4a4b3d..ad9d26e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This script does not support: This is a JavaScript module that exports: [`URI`](#uri) (default), [`SegmentedString`](#segmentedstring), [`isDNSDomain`](#isdnsdomain), [`parseMailbox`](#parsemailbox) -[Try it on JSFiddle](https://jsfiddle.net/wizard04/896dmhga/) +[Try it on JSFiddle](https://jsfiddle.net/wizard04/evxog8r2/1/) ---