Skip to content

Instantly share code, notes, and snippets.

@TimothyGu
Created September 2, 2018 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TimothyGu/5eb111b5021b338d516e97225a65bed4 to your computer and use it in GitHub Desktop.
Save TimothyGu/5eb111b5021b338d516e97225a65bed4 to your computer and use it in GitHub Desktop.
diff --git a/url.bs b/url.bs
index 6cb0f04..e49aa29 100644
--- a/url.bs
+++ b/url.bs
@@ -940,6 +940,138 @@ <h2 id=urls>URLs</h2>
for=/>URL</a> that was <a lt="URL serializer">serialized</a>.)
</ul>
+<div class=example>
+ <table>
+ <tr>
+ <td><code>https:</code>
+ <td><code>//</code>
+ <td><code>user</code>
+ <td><code>:</code>
+ <td><code>pass</code>
+ <td><code>@</code>
+ <td><code>sub.host.com</code>
+ <td><code>:</code>
+ <td><code>8080</code>
+ <td><code>/p/a/t/h</code>
+ <td><code>?query=string</code>
+ <td><code>#hash</code>
+ <tr>
+ <td>{{URL/protocol}}
+ <td>
+ <td>{{URL/username}}
+ <td>
+ <td>{{URL/password}}
+ <td>
+ <td>{{URL/hostname}}
+ <td>
+ <td>{{URL/port}}
+ <td>{{URL/pathname}}
+ <td>{{URL/search}}
+ <td>{{URL/hash}}
+ <tr>
+ <td colspan=6>
+ <td colspan=3>{{URL/host}}
+ <td colspan=3>
+ <tr>
+ <td colspan=12>{{URL/href}}
+ </table>
+
+<br>
+
+ <table>
+ <tr>
+ <td><code>https:</code>
+ <td><code>//</code>
+ <td><code>user</code>
+ <td><code>:</code>
+ <td><code>pass</code>
+ <td><code>@</code>
+ <td><code>sub.host.com</code>
+ <td><code>:</code>
+ <td><code>8080</code>
+ <td><code>/p/a/t/h</code>
+ <td><code>?query=string</code>
+ <td><code>#hash</code>
+ <tr>
+ <td colspan=6>
+ <td>{{URL/hostname}}
+ <td>
+ <td>{{URL/port}}
+ <td colspan=3>
+ <tr>
+ <td>{{URL/protocol}}
+ <td>
+ <td>{{URL/username}}
+ <td>
+ <td>{{URL/password}}
+ <td>
+ <td colspan=3>{{URL/host}}
+ <td>{{URL/pathname}}
+ <td>{{URL/search}}
+ <td>{{URL/hash}}
+ <tr>
+ <td colspan=12>{{URL/href}}
+ </table>
+
+<br>
+
+ <table>
+ <tr>
+ <td><code>https:</code>
+ <td><code>//</code>
+ <td><code>user</code>
+ <td><code>:</code>
+ <td><code>pass</code>
+ <td><code>@</code>
+ <td><code>sub.host.com</code>
+ <td><code>:</code>
+ <td><code>8080</code>
+ <td><code>/p/a/t/h</code>
+ <td><code>?query=string</code>
+ <td><code>#hash</code>
+ <tr>
+ <td colspan=6>
+ <td>{{URL/hostname}}
+ <td>
+ <td>{{URL/port}}
+ <td colspan=3>
+ <tr>
+ <td>{{URL/protocol}}
+ <td>
+ <td>{{URL/username}}
+ <td>
+ <td>{{URL/password}}
+ <td>
+ <td colspan=3>{{URL/host}}
+ <td>{{URL/pathname}}
+ <td>{{URL/search}}
+ <td>{{URL/hash}}
+ <tr>
+ <td colspan=2>{{URL/origin}}
+ <td colspan=4>
+ <td colspan=3>{{URL/origin}}
+ <tr>
+ <td colspan=12>{{URL/href}}
+ </table>
+
+<br>
+
+ <table>
+ <tr>
+ <td><code>urn:</code>
+ <td><code>ietf:rfc:3986</code>
+ <tr>
+ <td>{{URL/protocol}}
+ <td>{{URL/pathname}}
+ <tr>
+ <td colspan=2>{{URL/href}}
+ </table>
+</div>
+
+<br>
+<br>
+<br>
+
<div class=example id=example-url-parsing>
<table>
<tr>
@EnnexMB
Copy link

EnnexMB commented Sep 2, 2018

Thanks @TimothyGu.

I need some help with this. I'm not familiar with diff files. It appears that this is intended to be embedded in a larger piece of code and uses some syntax I'm not familiar with, especially the +s at the beginning of each line that are not operating on quoted strings and the {{URL/...}} wrappers. I copied the part from the first <table> to the last </table> into a new htm file, then removed the +s, and it does make tables, but they don't have borders or colors and the cell contents that are supposed to be red are wrapped in {{URL/...}}.

I presume all of this is explained somewhere. So rather than taking the time to explain it to me, is there documentation you can point me to on how diff files (or anything else related I need to know) work?

Sorry that I don't know this, but I'm new here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment