From d51c43b5a78f55a9d4908dba51697c0455fb5251 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Enrique=20Alc=C3=A1ntara?= <ealcantara@gitlab.com>
Date: Fri, 12 Aug 2022 12:13:16 +0000
Subject: [PATCH] Use DOMPurify to sanitize attributes in Content Editor

Use DOMPurify isValidAttribute function to
ensure that the attributes processed by
the client-side deserializer are not dangerous
---
 .../services/hast_to_prosemirror_converter.js |  13 +-
 .../services/remark_markdown_deserializer.js  |  41 ++-
 app/assets/javascripts/lib/dompurify.js       |   2 +
 glfm_specification/example_snapshots/html.yml | 260 +++++++--------
 .../example_snapshots/prosemirror_json.yml    | 296 +++++++++---------
 .../remark_markdown_processing_spec.js        |  92 +++++-
 .../services/markdown_serializer_spec.js      |  82 ++---
 7 files changed, 432 insertions(+), 354 deletions(-)

diff --git a/app/assets/javascripts/content_editor/services/hast_to_prosemirror_converter.js b/app/assets/javascripts/content_editor/services/hast_to_prosemirror_converter.js
index 5eda0ff8b1a8..28a50adca6b9 100644
--- a/app/assets/javascripts/content_editor/services/hast_to_prosemirror_converter.js
+++ b/app/assets/javascripts/content_editor/services/hast_to_prosemirror_converter.js
@@ -104,15 +104,16 @@ const getAttrsFactory = ({ attributeTransformer, markdown }) =>
   function getAttrs(proseMirrorNodeSpec, hastNode, hastParents) {
     const { getAttrs: specGetAttrs } = proseMirrorNodeSpec;
     const attributes = {
-      ...createSourceMapAttributes(hastNode, markdown),
       ...(isFunction(specGetAttrs) ? specGetAttrs(hastNode, hastParents, markdown) : {}),
     };
+    const { transform } = attributeTransformer;
 
-    return mapValues(attributes, (value, key) =>
-      attributeTransformer.attributes.includes(key)
-        ? attributeTransformer.transform(value, key)
-        : value,
-    );
+    return {
+      ...createSourceMapAttributes(hastNode, markdown),
+      ...mapValues(attributes, (attributeValue, attributeName) =>
+        transform(attributeName, attributeValue, hastNode),
+      ),
+    };
   };
 
 /**
diff --git a/app/assets/javascripts/content_editor/services/remark_markdown_deserializer.js b/app/assets/javascripts/content_editor/services/remark_markdown_deserializer.js
index b9203daf0e8f..66923a4eb4d2 100644
--- a/app/assets/javascripts/content_editor/services/remark_markdown_deserializer.js
+++ b/app/assets/javascripts/content_editor/services/remark_markdown_deserializer.js
@@ -1,4 +1,5 @@
 import { render } from '~/lib/gfm';
+import { isValidAttribute } from '~/lib/dompurify';
 import { createProseMirrorDocFromMdastTree } from './hast_to_prosemirror_converter';
 
 const wrappableTags = ['img', 'br', 'code', 'i', 'em', 'b', 'strong', 'a', 'strike', 's', 'del'];
@@ -184,28 +185,34 @@ const factorySpecs = {
   },
 };
 
-const resolveUrl = (url) => {
-  try {
-    return new URL(url, window.location.origin).toString();
-  } catch {
+const SANITIZE_ALLOWLIST = ['level', 'identifier', 'numeric', 'language', 'url'];
+
+const sanitizeAttribute = (attributeName, attributeValue, hastNode) => {
+  if (!attributeValue || SANITIZE_ALLOWLIST.includes(attributeName)) {
+    return attributeValue;
+  }
+
+  /**
+   * This is a workaround to validate the value of the canonicalSrc
+   * attribute using DOMPurify without passing the attribute name. canonicalSrc
+   * is not an allowed attribute in DOMPurify therefore the library will remove
+   * it regardless of its value.
+   *
+   * We want to preserve canonicalSrc, and we also want to make sure that its
+   * value is sanitized.
+   */
+  const validateAttributeAs = attributeName === 'canonicalSrc' ? 'src' : attributeName;
+
+  if (!isValidAttribute(hastNode.tagName, validateAttributeAs, attributeValue)) {
     return null;
   }
+
+  return attributeValue;
 };
 
 const attributeTransformer = {
-  attributes: ['href', 'src'],
-  transform: (url) => {
-    if (!url) {
-      return url;
-    }
-
-    /**
-     * Resolves a URL if provided. The URL is not resolved against
-     * the client origin initially to protect the URL protocol
-     * when it is available, for example, we want to preserve
-     * mailto and application-specific protocols
-     */
-    return resolveUrl(url);
+  transform: (attributeName, attributeValue, hastNode) => {
+    return sanitizeAttribute(attributeName, attributeValue, hastNode);
   },
 };
 
diff --git a/app/assets/javascripts/lib/dompurify.js b/app/assets/javascripts/lib/dompurify.js
index af7a1201889e..3e28ca2a0f78 100644
--- a/app/assets/javascripts/lib/dompurify.js
+++ b/app/assets/javascripts/lib/dompurify.js
@@ -93,3 +93,5 @@ addHook('afterSanitizeAttributes', (node) => {
 });
 
 export const sanitize = (val, config) => dompurifySanitize(val, { ...defaultConfig, ...config });
+
+export { isValidAttribute } from 'dompurify';
diff --git a/glfm_specification/example_snapshots/html.yml b/glfm_specification/example_snapshots/html.yml
index f89f03ecc31e..8a54ee6f3607 100644
--- a/glfm_specification/example_snapshots/html.yml
+++ b/glfm_specification/example_snapshots/html.yml
@@ -1682,7 +1682,7 @@
   static: |-
     <div><a href="bar">*foo*</a></div>
   wysiwyg: |-
-    <div><p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/bar" canonicalsrc="bar">*foo*</a></p></div>
+    <div><p><a target="_blank" rel="noopener noreferrer nofollow" href="bar" canonicalsrc="bar">*foo*</a></p></div>
 04_06__leaf_blocks__html_blocks__013:
   canonical: |
     <table><tr><td>
@@ -1723,7 +1723,7 @@
     *bar*
     </a>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/foo" canonicalsrc="foo">
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="foo" canonicalsrc="foo">
     *bar*
     </a></p>
 04_06__leaf_blocks__html_blocks__016:
@@ -2065,7 +2065,7 @@
     baz</a></p>
   wysiwyg: |-
     <p>Foo
-    <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/bar" canonicalsrc="bar">
+    <a target="_blank" rel="noopener noreferrer nofollow" href="bar" canonicalsrc="bar">
     baz</a></p>
 04_06__leaf_blocks__html_blocks__040:
   canonical: |
@@ -2145,7 +2145,7 @@
     <p data-sourcepos="3:1-3:5" dir="auto"><a href="/url" title="title">foo</a></p>
   wysiwyg: |-
     <pre>[foo]: /url "title"</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">foo</a></p>
 04_07__leaf_blocks__link_reference_definitions__002:
   canonical: |
     <p><a href="/url" title="the title">foo</a></p>
@@ -2153,7 +2153,7 @@
     <p data-sourcepos="5:1-5:5" dir="auto"><a href="/url" title="the title">foo</a></p>
   wysiwyg: |-
     <pre>[foo]: /url "the title"</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="the title" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="the title" canonicalsrc="/url">foo</a></p>
 04_07__leaf_blocks__link_reference_definitions__003:
   canonical: |
     <p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p>
@@ -2161,7 +2161,7 @@
     <p data-sourcepos="3:1-3:11" dir="auto"><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p>
   wysiwyg: |-
     <pre>[foo*bar\]]: my_(url) "title (with parens)"</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/my_(url)" title="title (with parens)" canonicalsrc="my_(url)">Foo*bar]</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="my_(url)" title="title (with parens)" canonicalsrc="my_(url)">Foo*bar]</a></p>
 04_07__leaf_blocks__link_reference_definitions__004:
   canonical: |
     <p><a href="my%20url" title="title">Foo bar</a></p>
@@ -2169,7 +2169,7 @@
     <p data-sourcepos="5:1-5:9" dir="auto"><a href="my%20url" title="title">Foo bar</a></p>
   wysiwyg: |-
     <pre>[foo bar]: my url "title"</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/my%20url" title="title" canonicalsrc="my%20url">Foo bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="my%20url" title="title" canonicalsrc="my%20url">Foo bar</a></p>
 04_07__leaf_blocks__link_reference_definitions__005:
   canonical: |
     <p><a href="/url" title="
@@ -2189,7 +2189,7 @@
     line1
     line2
     "</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="
     title
     line1
     line2
@@ -2214,7 +2214,7 @@
     <p data-sourcepos="4:1-4:5" dir="auto"><a href="/url">foo</a></p>
   wysiwyg: |-
     <pre>[foo]: /url</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">foo</a></p>
 04_07__leaf_blocks__link_reference_definitions__008:
   canonical: |
     <p>[foo]:</p>
@@ -2250,14 +2250,14 @@
     <p data-sourcepos="3:1-3:5" dir="auto"><a href="/url%5Cbar*baz" title='foo"bar\baz'>foo</a></p>
   wysiwyg: |-
     <pre>[foo]: /url\bar*baz "foo"bar\baz"</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url%5Cbar*baz" title="foo&quot;bar\baz" canonicalsrc="/url%5Cbar*baz">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url%5Cbar*baz" title="foo&quot;bar\baz" canonicalsrc="/url%5Cbar*baz">foo</a></p>
 04_07__leaf_blocks__link_reference_definitions__012:
   canonical: |
     <p><a href="url">foo</a></p>
   static: |-
     <p data-sourcepos="1:1-1:5" dir="auto"><a href="url">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="url" canonicalsrc="url">foo</a></p>
     <pre>[foo]: url</pre>
 04_07__leaf_blocks__link_reference_definitions__013:
   canonical: |
@@ -2265,7 +2265,7 @@
   static: |-
     <p data-sourcepos="1:1-1:5" dir="auto"><a href="first">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/first" canonicalsrc="first">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="first" canonicalsrc="first">foo</a></p>
     <pre>[foo]: first</pre>
     <pre>[foo]: second</pre>
 04_07__leaf_blocks__link_reference_definitions__014:
@@ -2275,7 +2275,7 @@
     <p data-sourcepos="3:1-3:5" dir="auto"><a href="/url">Foo</a></p>
   wysiwyg: |-
     <pre>[foo]: /url</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">Foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">Foo</a></p>
 04_07__leaf_blocks__link_reference_definitions__015:
   canonical: |
     <p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p>
@@ -2283,7 +2283,7 @@
     <p data-sourcepos="3:1-3:8" dir="auto"><a href="/%CF%86%CE%BF%CF%85">αγω</a></p>
   wysiwyg: |-
     <pre>[αγω]: /φου</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/%CF%86%CE%BF%CF%85" canonicalsrc="/%CF%86%CE%BF%CF%85">αγω</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/%CF%86%CE%BF%CF%85" canonicalsrc="/%CF%86%CE%BF%CF%85">αγω</a></p>
 04_07__leaf_blocks__link_reference_definitions__016:
   canonical: ""
   static: ""
@@ -2367,7 +2367,7 @@
     <p data-sourcepos="3:3-3:5">bar</p>
     </blockquote>
   wysiwyg: |-
-    <h1><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">Foo</a></h1>
+    <h1><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">Foo</a></h1>
     <pre>[foo]: /url</pre>
     <blockquote multiline="false"><p>bar</p></blockquote>
 04_07__leaf_blocks__link_reference_definitions__024:
@@ -2381,7 +2381,7 @@
   wysiwyg: |-
     <pre>[foo]: /url</pre>
     <h1>bar</h1>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">foo</a></p>
 04_07__leaf_blocks__link_reference_definitions__025:
   canonical: |
     <p>===
@@ -2392,7 +2392,7 @@
   wysiwyg: |-
     <pre>[foo]: /url</pre>
     <p>===
-    <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">foo</a></p>
+    <a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">foo</a></p>
 04_07__leaf_blocks__link_reference_definitions__026:
   canonical: |
     <p><a href="/foo-url" title="foo">foo</a>,
@@ -2406,9 +2406,9 @@
     <pre>[foo]: /foo-url "foo"</pre>
     <pre>[bar]: /bar-url "bar"</pre>
     <pre>[baz]: /baz-url</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/foo-url" title="foo" canonicalsrc="/foo-url">foo</a>,
-    <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/bar-url" title="bar" canonicalsrc="/bar-url">bar</a>,
-    <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/baz-url" canonicalsrc="/baz-url">baz</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/foo-url" title="foo" canonicalsrc="/foo-url">foo</a>,
+    <a target="_blank" rel="noopener noreferrer nofollow" href="/bar-url" title="bar" canonicalsrc="/bar-url">bar</a>,
+    <a target="_blank" rel="noopener noreferrer nofollow" href="/baz-url" canonicalsrc="/baz-url">baz</a></p>
 04_07__leaf_blocks__link_reference_definitions__027:
   canonical: |
     <p><a href="/url">foo</a></p>
@@ -2419,7 +2419,7 @@
     <blockquote data-sourcepos="3:1-3:13" dir="auto">
     </blockquote>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">foo</a></p>
     <blockquote multiline="false"><pre>[foo]: /url</pre></blockquote>
 04_07__leaf_blocks__link_reference_definitions__028:
   canonical: ""
@@ -4883,7 +4883,7 @@
   static: |-
     <p data-sourcepos="1:1-1:28" dir="auto"><a href="http://example.com?find=%5C*" rel="nofollow noreferrer noopener" target="_blank">http://example.com?find=\*</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://example.com/?find=%5C*" canonicalsrc="http://example.com?find=%5C*">http://example.com?find=\*</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://example.com?find=%5C*" canonicalsrc="http://example.com?find=%5C*">http://example.com?find=\*</a></p>
 06_02__inlines__backslash_escapes__010:
   canonical: |
     <a href="/bar\/)">
@@ -4897,14 +4897,14 @@
   static: |-
     <p data-sourcepos="1:1-1:23" dir="auto"><a href="/bar*" title="ti*tle">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/bar*" title="ti*tle" canonicalsrc="/bar*">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/bar*" title="ti*tle" canonicalsrc="/bar*">foo</a></p>
 06_02__inlines__backslash_escapes__012:
   canonical: |
     <p><a href="/bar*" title="ti*tle">foo</a></p>
   static: |-
     <p data-sourcepos="1:1-1:5" dir="auto"><a href="/bar*" title="ti*tle">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/bar*" title="ti*tle" canonicalsrc="/bar*">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/bar*" title="ti*tle" canonicalsrc="/bar*">foo</a></p>
     <pre>[foo]: /bar* "ti*tle"</pre>
 06_02__inlines__backslash_escapes__013:
   canonical: |
@@ -4987,14 +4987,14 @@
   static: |-
     <p data-sourcepos="1:1-1:37" dir="auto"><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/f%C3%B6%C3%B6" title="föö" canonicalsrc="/f%C3%B6%C3%B6">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/f%C3%B6%C3%B6" title="föö" canonicalsrc="/f%C3%B6%C3%B6">foo</a></p>
 06_03__inlines__entity_and_numeric_character_references__009:
   canonical: |
     <p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
   static: |-
     <p data-sourcepos="1:1-1:5" dir="auto"><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/f%C3%B6%C3%B6" title="föö" canonicalsrc="/f%C3%B6%C3%B6">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/f%C3%B6%C3%B6" title="föö" canonicalsrc="/f%C3%B6%C3%B6">foo</a></p>
     <pre>[foo]: /föö "föö"</pre>
 06_03__inlines__entity_and_numeric_character_references__010:
   canonical: |
@@ -5193,7 +5193,7 @@
   static: |-
     <p data-sourcepos="1:1-1:13" dir="auto"><a href="%60" rel="nofollow noreferrer noopener" target="_blank">`</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/%60" canonicalsrc="`">`</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="`" canonicalsrc="`">`</a></p>
 06_04__inlines__code_spans__018:
   canonical: |
     <p><code>&lt;http://foo.bar.</code>baz&gt;`</p>
@@ -5207,7 +5207,7 @@
   static: |-
     <p data-sourcepos="1:1-1:22" dir="auto"><a href="http://foo.bar.%60baz" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar.`baz</a>`</p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://foo.bar.`baz/" canonicalsrc="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://foo.bar.%60baz" canonicalsrc="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p>
 06_04__inlines__code_spans__020:
   canonical: |
     <p>```foo``</p>
@@ -5615,7 +5615,7 @@
   static: |-
     <p data-sourcepos="1:1-1:17" dir="auto"><em>foo <a href="/url">bar</a></em></p>
   wysiwyg: |-
-    <p><em>foo </em><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url"><em>bar</em></a></p>
+    <p><em>foo </em><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url"><em>bar</em></a></p>
 06_05__inlines__emphasis_and_strong_emphasis__055:
   canonical: |
     <p><em>foo
@@ -5723,7 +5723,7 @@
   static: |-
     <p data-sourcepos="1:1-1:19" dir="auto"><em>foo <a href="/url"><em>bar</em></a></em></p>
   wysiwyg: |-
-    <p><em>foo </em><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url"><em>bar</em></a></p>
+    <p><em>foo </em><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url"><em>bar</em></a></p>
 06_05__inlines__emphasis_and_strong_emphasis__070:
   canonical: |
     <p>** is not an empty emphasis</p>
@@ -5744,7 +5744,7 @@
   static: |-
     <p data-sourcepos="1:1-1:19" dir="auto"><strong>foo <a href="/url">bar</a></strong></p>
   wysiwyg: |-
-    <p><strong>foo </strong><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url"><strong>bar</strong></a></p>
+    <p><strong>foo </strong><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url"><strong>bar</strong></a></p>
 06_05__inlines__emphasis_and_strong_emphasis__073:
   canonical: |
     <p><strong>foo
@@ -5827,7 +5827,7 @@
   static: |-
     <p data-sourcepos="1:1-1:21" dir="auto"><strong>foo <a href="/url"><em>bar</em></a></strong></p>
   wysiwyg: |-
-    <p><strong>foo </strong><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url"><strong><em>bar</em></strong></a></p>
+    <p><strong>foo </strong><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url"><strong><em>bar</em></strong></a></p>
 06_05__inlines__emphasis_and_strong_emphasis__084:
   canonical: |
     <p>__ is not an empty emphasis</p>
@@ -6107,21 +6107,21 @@
   static: |-
     <p data-sourcepos="1:1-1:13" dir="auto">*<a href="/url">bar*</a></p>
   wysiwyg: |-
-    <p>*<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">bar*</a></p>
+    <p>*<a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">bar*</a></p>
 06_05__inlines__emphasis_and_strong_emphasis__124:
   canonical: |
     <p>_foo <a href="/url">bar_</a></p>
   static: |-
     <p data-sourcepos="1:1-1:17" dir="auto">_foo <a href="/url">bar_</a></p>
   wysiwyg: |-
-    <p>_foo <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">bar_</a></p>
+    <p>_foo <a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">bar_</a></p>
 06_05__inlines__emphasis_and_strong_emphasis__125:
   canonical: |
     <p>*<img src="foo" title="*"/></p>
   static: |-
     <p data-sourcepos="1:1-1:27" dir="auto">*<a class="no-attachment-icon" href="foo" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" title="*" decoding="async" class="lazy" data-src="foo"></a></p>
   wysiwyg: |-
-    <p>*<img src="http://test.host/foo" title="*" data-canonical-src="foo"></p>
+    <p>*<img src="foo" title="*" data-canonical-src="foo"></p>
 06_05__inlines__emphasis_and_strong_emphasis__126:
   canonical: |
     <p>**<a href="**"></p>
@@ -6187,14 +6187,14 @@
   static: |-
     <p data-sourcepos="1:1-1:20" dir="auto"><a href="/uri" title="title">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" title="title" canonicalsrc="/uri">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" title="title" canonicalsrc="/uri">link</a></p>
 06_07__inlines__links__002:
   canonical: |
     <p><a href="/uri">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:12" dir="auto"><a href="/uri">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">link</a></p>
 06_07__inlines__links__003:
   canonical: |
     <p><a href="">link</a></p>
@@ -6222,7 +6222,7 @@
   static: |-
     <p data-sourcepos="1:1-1:17" dir="auto"><a href="/my%20uri">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/my%20uri" canonicalsrc="/my%20uri">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/my%20uri" canonicalsrc="/my%20uri">link</a></p>
 06_07__inlines__links__007:
   canonical: |
     <p>[link](foo
@@ -6247,7 +6247,7 @@
   static: |-
     <p data-sourcepos="1:1-1:10" dir="auto"><a href="b)c">a</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/b)c" canonicalsrc="b)c">a</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="b)c" canonicalsrc="b)c">a</a></p>
 06_07__inlines__links__010:
   canonical: |
     <p>[link](&lt;foo&gt;)</p>
@@ -6274,35 +6274,35 @@
   static: |-
     <p data-sourcepos="1:1-1:15" dir="auto"><a href="(foo)">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/(foo)" canonicalsrc="(foo)">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="(foo)" canonicalsrc="(foo)">link</a></p>
 06_07__inlines__links__013:
   canonical: |
     <p><a href="foo(and(bar))">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:21" dir="auto"><a href="foo(and(bar))">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/foo(and(bar))" canonicalsrc="foo(and(bar))">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="foo(and(bar))" canonicalsrc="foo(and(bar))">link</a></p>
 06_07__inlines__links__014:
   canonical: |
     <p><a href="foo(and(bar)">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:23" dir="auto"><a href="foo(and(bar)">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/foo(and(bar)" canonicalsrc="foo(and(bar)">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="foo(and(bar)" canonicalsrc="foo(and(bar)">link</a></p>
 06_07__inlines__links__015:
   canonical: |
     <p><a href="foo(and(bar)">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:22" dir="auto"><a href="foo(and(bar)">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/foo(and(bar)" canonicalsrc="foo(and(bar)">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="foo(and(bar)" canonicalsrc="foo(and(bar)">link</a></p>
 06_07__inlines__links__016:
   canonical: |
     <p><a href="foo):">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:15" dir="auto"><a>link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/foo):" canonicalsrc="foo):">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="foo):" canonicalsrc="foo):">link</a></p>
 06_07__inlines__links__017:
   canonical: |
     <p><a href="#fragment">link</a></p>
@@ -6313,30 +6313,30 @@
     <p data-sourcepos="3:1-3:35" dir="auto"><a href="http://example.com#fragment" rel="nofollow noreferrer noopener" target="_blank">link</a></p>
     <p data-sourcepos="5:1-5:37" dir="auto"><a href="http://example.com?foo=3#frag" rel="nofollow noreferrer noopener" target="_blank">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/#fragment" canonicalsrc="#fragment">link</a></p>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://example.com/#fragment" canonicalsrc="http://example.com#fragment">link</a></p>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://example.com/?foo=3#frag" canonicalsrc="http://example.com?foo=3#frag">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="#fragment" canonicalsrc="#fragment">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://example.com#fragment" canonicalsrc="http://example.com#fragment">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://example.com?foo=3#frag" canonicalsrc="http://example.com?foo=3#frag">link</a></p>
 06_07__inlines__links__018:
   canonical: |
     <p><a href="foo%5Cbar">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:15" dir="auto"><a href="foo%5Cbar">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/foo%5Cbar" canonicalsrc="foo%5Cbar">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="foo%5Cbar" canonicalsrc="foo%5Cbar">link</a></p>
 06_07__inlines__links__019:
   canonical: |
     <p><a href="foo%20b%C3%A4">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:21" dir="auto"><a href="foo%20b%C3%A4">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/foo%20b%C3%A4" canonicalsrc="foo%20b%C3%A4">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="foo%20b%C3%A4" canonicalsrc="foo%20b%C3%A4">link</a></p>
 06_07__inlines__links__020:
   canonical: |
     <p><a href="%22title%22">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:15" dir="auto"><a href="%22title%22">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/%22title%22" canonicalsrc="%22title%22">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="%22title%22" canonicalsrc="%22title%22">link</a></p>
 06_07__inlines__links__021:
   canonical: |
     <p><a href="/url" title="title">link</a>
@@ -6347,21 +6347,21 @@
     <a href="/url" title="title">link</a>
     <a href="/url" title="title">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">linklinklink</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">linklinklink</a></p>
 06_07__inlines__links__022:
   canonical: |
     <p><a href="/url" title="title &quot;&quot;">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:29" dir="auto"><a href="/url" title='title ""'>link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title &quot;&quot;" canonicalsrc="/url">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title &quot;&quot;" canonicalsrc="/url">link</a></p>
 06_07__inlines__links__023:
   canonical: |
     <p><a href="/url%C2%A0%22title%22">link</a></p>
   static: |-
     <p data-sourcepos="1:1-1:21" dir="auto"><a href="/url%C2%A0%22title%22">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url%C2%A0%22title%22" canonicalsrc="/url%C2%A0%22title%22">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url%C2%A0%22title%22" canonicalsrc="/url%C2%A0%22title%22">link</a></p>
 06_07__inlines__links__024:
   canonical: |
     <p>[link](/url &quot;title &quot;and&quot; title&quot;)</p>
@@ -6375,14 +6375,14 @@
   static: |-
     <p data-sourcepos="1:1-1:32" dir="auto"><a href="/url" title='title "and" title'>link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title &quot;and&quot; title" canonicalsrc="/url">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title &quot;and&quot; title" canonicalsrc="/url">link</a></p>
 06_07__inlines__links__026:
   canonical: |
     <p><a href="/uri" title="title">link</a></p>
   static: |-
     <p data-sourcepos="1:1-2:12" dir="auto"><a href="/uri" title="title">link</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" title="title" canonicalsrc="/uri">link</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" title="title" canonicalsrc="/uri">link</a></p>
 06_07__inlines__links__027:
   canonical: |
     <p>[link] (/uri)</p>
@@ -6396,7 +6396,7 @@
   static: |-
     <p data-sourcepos="1:1-1:24" dir="auto"><a href="/uri">link [foo [bar]]</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">link [foo [bar]]</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">link [foo [bar]]</a></p>
 06_07__inlines__links__029:
   canonical: |
     <p>[link] bar](/uri)</p>
@@ -6410,63 +6410,63 @@
   static: |-
     <p data-sourcepos="1:1-1:17" dir="auto">[link <a href="/uri">bar</a></p>
   wysiwyg: |-
-    <p>[link <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">bar</a></p>
+    <p>[link <a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">bar</a></p>
 06_07__inlines__links__031:
   canonical: |
     <p><a href="/uri">link [bar</a></p>
   static: |-
     <p data-sourcepos="1:1-1:18" dir="auto"><a href="/uri">link [bar</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">link [bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">link [bar</a></p>
 06_07__inlines__links__032:
   canonical: |
     <p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>
   static: |-
     <p data-sourcepos="1:1-1:30" dir="auto"><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">link <em>foo </em><strong><em>bar<code>#</code></em></strong></a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">link <em>foo </em><strong><em>bar<code>#</code></em></strong></a></p>
 06_07__inlines__links__033:
   canonical: |
     <p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p>
   static: |-
     <p data-sourcepos="1:1-1:25" dir="auto"><a href="/uri"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="moon" decoding="async" class="lazy" data-src="moon.jpg"></a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri"><img src="http://test.host/moon.jpg" alt="moon" data-canonical-src="moon.jpg"></a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri"><img src="moon.jpg" alt="moon" data-canonical-src="moon.jpg"></a></p>
 06_07__inlines__links__034:
   canonical: |
     <p>[foo <a href="/uri">bar</a>](/uri)</p>
   static: |-
     <p data-sourcepos="1:1-1:23" dir="auto">[foo <a href="/uri">bar</a>](/uri)</p>
   wysiwyg: |-
-    <p>[foo <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">bar</a>](/uri)</p>
+    <p>[foo <a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">bar</a>](/uri)</p>
 06_07__inlines__links__035:
   canonical: |
     <p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p>
   static: |-
     <p data-sourcepos="1:1-1:37" dir="auto">[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p>
   wysiwyg: |-
-    <p>[foo <em>[bar </em><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri"><em>baz</em></a><em>](/uri)</em>](/uri)</p>
+    <p>[foo <em>[bar </em><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri"><em>baz</em></a><em>](/uri)</em>](/uri)</p>
 06_07__inlines__links__036:
   canonical: |
     <p><img src="uri3" alt="[foo](uri2)" /></p>
   static: |-
     <p data-sourcepos="1:1-1:28" dir="auto"><a class="no-attachment-icon" href="uri3" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="[foo](uri2)" decoding="async" class="lazy" data-src="uri3"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/uri3" alt="[foo](uri2)" data-canonical-src="uri3"></p>
+    <p><img src="uri3" alt="[foo](uri2)" data-canonical-src="uri3"></p>
 06_07__inlines__links__037:
   canonical: |
     <p>*<a href="/uri">foo*</a></p>
   static: |-
     <p data-sourcepos="1:1-1:13" dir="auto">*<a href="/uri">foo*</a></p>
   wysiwyg: |-
-    <p>*<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">foo*</a></p>
+    <p>*<a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">foo*</a></p>
 06_07__inlines__links__038:
   canonical: |
     <p><a href="baz*">foo *bar</a></p>
   static: |-
     <p data-sourcepos="1:1-1:16" dir="auto"><a href="baz*">foo *bar</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/baz*" canonicalsrc="baz*">foo *bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="baz*" canonicalsrc="baz*">foo *bar</a></p>
 06_07__inlines__links__039:
   canonical: |
     <p><em>foo [bar</em> baz]</p>
@@ -6501,7 +6501,7 @@
   static: |-
     <p data-sourcepos="1:1-1:10" dir="auto"><a href="/url" title="title">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">foo</a></p>
     <pre>[bar]: /url "title"</pre>
 06_07__inlines__links__044:
   canonical: |
@@ -6509,7 +6509,7 @@
   static: |-
     <p data-sourcepos="1:1-1:23" dir="auto"><a href="/uri">link [foo [bar]]</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">link [foo [bar]]</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">link [foo [bar]]</a></p>
     <pre>[ref]: /uri</pre>
 06_07__inlines__links__045:
   canonical: |
@@ -6517,7 +6517,7 @@
   static: |-
     <p data-sourcepos="1:1-1:17" dir="auto"><a href="/uri">link [bar</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">link [bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">link [bar</a></p>
     <pre>[ref]: /uri</pre>
 06_07__inlines__links__046:
   canonical: |
@@ -6525,7 +6525,7 @@
   static: |-
     <p data-sourcepos="1:1-1:29" dir="auto"><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">link <em>foo </em><strong><em>bar<code>#</code></em></strong></a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">link <em>foo </em><strong><em>bar<code>#</code></em></strong></a></p>
     <pre>[ref]: /uri</pre>
 06_07__inlines__links__047:
   canonical: |
@@ -6533,7 +6533,7 @@
   static: |-
     <p data-sourcepos="1:1-1:24" dir="auto"><a href="/uri"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="moon" decoding="async" class="lazy" data-src="moon.jpg"></a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri"><img src="http://test.host/moon.jpg" alt="moon" data-canonical-src="moon.jpg"></a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri"><img src="moon.jpg" alt="moon" data-canonical-src="moon.jpg"></a></p>
     <pre>[ref]: /uri</pre>
 06_07__inlines__links__048:
   canonical: |
@@ -6541,7 +6541,7 @@
   static: |-
     <p data-sourcepos="1:1-1:22" dir="auto">[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p>
   wysiwyg: |-
-    <p>[foo <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">bar</a>]<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">ref</a></p>
+    <p>[foo <a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">bar</a>]<a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">ref</a></p>
     <pre>[ref]: /uri</pre>
 06_07__inlines__links__049:
   canonical: |
@@ -6549,7 +6549,7 @@
   static: |-
     <p data-sourcepos="1:1-1:27" dir="auto">[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p>
   wysiwyg: |-
-    <p>[foo <em>bar </em><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri"><em>baz</em></a>]<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">ref</a></p>
+    <p>[foo <em>bar </em><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri"><em>baz</em></a>]<a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">ref</a></p>
     <pre>[ref]: /uri</pre>
 06_07__inlines__links__050:
   canonical: |
@@ -6557,7 +6557,7 @@
   static: |-
     <p data-sourcepos="1:1-1:12" dir="auto">*<a href="/uri">foo*</a></p>
   wysiwyg: |-
-    <p>*<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">foo*</a></p>
+    <p>*<a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">foo*</a></p>
     <pre>[ref]: /uri</pre>
 06_07__inlines__links__051:
   canonical: |
@@ -6565,7 +6565,7 @@
   static: |-
     <p data-sourcepos="1:1-1:15" dir="auto"><a href="/uri">foo *bar</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">foo *bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">foo *bar</a></p>
     <pre>[ref]: /uri</pre>
 06_07__inlines__links__052:
   canonical: |
@@ -6597,7 +6597,7 @@
   static: |-
     <p data-sourcepos="1:1-1:10" dir="auto"><a href="/url" title="title">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">foo</a></p>
     <pre>[bar]: /url "title"</pre>
 06_07__inlines__links__056:
   canonical: |
@@ -6605,7 +6605,7 @@
   static: |-
     <p data-sourcepos="1:1-1:47" dir="auto"><a href="/url">Толпой</a> is a Russian word.</p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">Толпой</a> is a Russian word.</p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">Толпой</a> is a Russian word.</p>
     <pre>[толпой]: /url</pre>
 06_07__inlines__links__057:
   canonical: |
@@ -6614,14 +6614,14 @@
     <p data-sourcepos="4:1-4:14" dir="auto"><a href="/url">Baz</a></p>
   wysiwyg: |-
     <pre>[foo bar]: /url</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">Baz</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">Baz</a></p>
 06_07__inlines__links__058:
   canonical: |
     <p>[foo] <a href="/url" title="title">bar</a></p>
   static: |-
     <p data-sourcepos="1:1-1:11" dir="auto">[foo] <a href="/url" title="title">bar</a></p>
   wysiwyg: |-
-    <p>[foo] <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">bar</a></p>
+    <p>[foo] <a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">bar</a></p>
     <pre>[bar]: /url "title"</pre>
 06_07__inlines__links__059:
   canonical: |
@@ -6632,7 +6632,7 @@
     <a href="/url" title="title">bar</a></p>
   wysiwyg: |-
     <p>[foo]
-    <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">bar</a></p>
+    <a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">bar</a></p>
     <pre>[bar]: /url "title"</pre>
 06_07__inlines__links__060:
   canonical: |
@@ -6642,7 +6642,7 @@
   wysiwyg: |-
     <pre>[foo]: /url1</pre>
     <pre>[foo]: /url2</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url1" canonicalsrc="/url1">bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url1" canonicalsrc="/url1">bar</a></p>
 06_07__inlines__links__061:
   canonical: |
     <p>[bar][foo!]</p>
@@ -6687,7 +6687,7 @@
   static: |-
     <p data-sourcepos="1:1-1:12" dir="auto"><a href="/uri">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">foo</a></p>
     <pre>[ref\[]: /uri</pre>
 06_07__inlines__links__066:
   canonical: |
@@ -6696,7 +6696,7 @@
     <p data-sourcepos="3:1-3:7" dir="auto"><a href="/uri">bar\</a></p>
   wysiwyg: |-
     <pre>[bar\\]: /uri</pre>
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/uri" canonicalsrc="/uri">bar\</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/uri" canonicalsrc="/uri">bar\</a></p>
 06_07__inlines__links__067:
   canonical: |
     <p>[]</p>
@@ -6729,7 +6729,7 @@
   static: |-
     <p data-sourcepos="1:1-1:7" dir="auto"><a href="/url" title="title">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">foo</a></p>
     <pre>[foo]: /url "title"</pre>
 06_07__inlines__links__070:
   canonical: |
@@ -6737,7 +6737,7 @@
   static: |-
     <p data-sourcepos="1:1-1:13" dir="auto"><a href="/url" title="title"><em>foo</em> bar</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url"><em>foo</em> bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url"><em>foo</em> bar</a></p>
     <pre>[*foo* bar]: /url "title"</pre>
 06_07__inlines__links__071:
   canonical: |
@@ -6745,7 +6745,7 @@
   static: |-
     <p data-sourcepos="1:1-1:7" dir="auto"><a href="/url" title="title">Foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">Foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">Foo</a></p>
     <pre>[foo]: /url "title"</pre>
 06_07__inlines__links__072:
   canonical: |
@@ -6755,7 +6755,7 @@
     <p data-sourcepos="1:1-2:2" dir="auto"><a href="/url" title="title">foo</a>
     []</p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">foo</a>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">foo</a>
     []</p>
     <pre>[foo]: /url "title"</pre>
 06_07__inlines__links__073:
@@ -6764,7 +6764,7 @@
   static: |-
     <p data-sourcepos="1:1-1:5" dir="auto"><a href="/url" title="title">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">foo</a></p>
     <pre>[foo]: /url "title"</pre>
 06_07__inlines__links__074:
   canonical: |
@@ -6772,7 +6772,7 @@
   static: |-
     <p data-sourcepos="1:1-1:11" dir="auto"><a href="/url" title="title"><em>foo</em> bar</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url"><em>foo</em> bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url"><em>foo</em> bar</a></p>
     <pre>[*foo* bar]: /url "title"</pre>
 06_07__inlines__links__075:
   canonical: |
@@ -6780,7 +6780,7 @@
   static: |-
     <p data-sourcepos="1:1-1:13" dir="auto">[<a href="/url" title="title"><em>foo</em> bar</a>]</p>
   wysiwyg: |-
-    <p>[<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url"><em>foo</em> bar</a>]</p>
+    <p>[<a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url"><em>foo</em> bar</a>]</p>
     <pre>[*foo* bar]: /url "title"</pre>
 06_07__inlines__links__076:
   canonical: |
@@ -6788,7 +6788,7 @@
   static: |-
     <p data-sourcepos="1:1-1:11" dir="auto">[[bar <a href="/url">foo</a></p>
   wysiwyg: |-
-    <p>[[bar <a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">foo</a></p>
+    <p>[[bar <a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">foo</a></p>
     <pre>[foo]: /url</pre>
 06_07__inlines__links__077:
   canonical: |
@@ -6796,7 +6796,7 @@
   static: |-
     <p data-sourcepos="1:1-1:5" dir="auto"><a href="/url" title="title">Foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">Foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">Foo</a></p>
     <pre>[foo]: /url "title"</pre>
 06_07__inlines__links__078:
   canonical: |
@@ -6804,7 +6804,7 @@
   static: |-
     <p data-sourcepos="1:1-1:9" dir="auto"><a href="/url">foo</a> bar</p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">foo</a> bar</p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">foo</a> bar</p>
     <pre>[foo]: /url</pre>
 06_07__inlines__links__079:
   canonical: |
@@ -6821,14 +6821,14 @@
     <p data-sourcepos="3:1-3:7" dir="auto">*<a href="/url">foo*</a></p>
   wysiwyg: |-
     <pre>[foo*]: /url</pre>
-    <p>*<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">foo*</a></p>
+    <p>*<a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">foo*</a></p>
 06_07__inlines__links__081:
   canonical: |
     <p><a href="/url2">foo</a></p>
   static: |-
     <p data-sourcepos="1:1-1:10" dir="auto"><a href="/url2">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url2" canonicalsrc="/url2">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url2" canonicalsrc="/url2">foo</a></p>
     <pre>[foo]: /url1</pre>
     <pre>[bar]: /url2</pre>
 06_07__inlines__links__082:
@@ -6837,7 +6837,7 @@
   static: |-
     <p data-sourcepos="1:1-1:7" dir="auto"><a href="/url1">foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url1" canonicalsrc="/url1">foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url1" canonicalsrc="/url1">foo</a></p>
     <pre>[foo]: /url1</pre>
 06_07__inlines__links__083:
   canonical: |
@@ -6853,7 +6853,7 @@
   static: |-
     <p data-sourcepos="1:1-1:17" dir="auto"><a href="/url1">foo</a>(not a link)</p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url1" canonicalsrc="/url1">foo</a>(not a link)</p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url1" canonicalsrc="/url1">foo</a>(not a link)</p>
     <pre>[foo]: /url1</pre>
 06_07__inlines__links__085:
   canonical: |
@@ -6861,7 +6861,7 @@
   static: |-
     <p data-sourcepos="1:1-1:15" dir="auto">[foo]<a href="/url">bar</a></p>
   wysiwyg: |-
-    <p>[foo]<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" canonicalsrc="/url">bar</a></p>
+    <p>[foo]<a target="_blank" rel="noopener noreferrer nofollow" href="/url" canonicalsrc="/url">bar</a></p>
     <pre>[baz]: /url</pre>
 06_07__inlines__links__086:
   canonical: |
@@ -6869,7 +6869,7 @@
   static: |-
     <p data-sourcepos="1:1-1:15" dir="auto"><a href="/url2">foo</a><a href="/url1">baz</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url2" canonicalsrc="/url2">foo</a><a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url1" canonicalsrc="/url1">baz</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="/url2" canonicalsrc="/url2">foo</a><a target="_blank" rel="noopener noreferrer nofollow" href="/url1" canonicalsrc="/url1">baz</a></p>
     <pre>[baz]: /url1</pre>
     <pre>[bar]: /url2</pre>
 06_07__inlines__links__087:
@@ -6878,7 +6878,7 @@
   static: |-
     <p data-sourcepos="1:1-1:15" dir="auto">[foo]<a href="/url1">bar</a></p>
   wysiwyg: |-
-    <p>[foo]<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url1" canonicalsrc="/url1">bar</a></p>
+    <p>[foo]<a target="_blank" rel="noopener noreferrer nofollow" href="/url1" canonicalsrc="/url1">bar</a></p>
     <pre>[baz]: /url1</pre>
     <pre>[foo]: /url2</pre>
 06_08__inlines__images__001:
@@ -6887,14 +6887,14 @@
   static: |-
     <p data-sourcepos="1:1-1:20" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo" title="title" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="foo" title="title" data-canonical-src="/url"></p>
 06_08__inlines__images__002:
   canonical: |
     <p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
   static: |-
     <p data-sourcepos="1:1-1:12" dir="auto"><a class="no-attachment-icon" href="train.jpg" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="train &amp; tracks" decoding="async" class="lazy" data-src="train.jpg"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/train.jpg" alt="foo bar" title="train &amp; tracks" data-canonical-src="train.jpg"></p>
+    <p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" data-canonical-src="train.jpg"></p>
     <pre>[foo *bar*]: train.jpg "train &amp; tracks"</pre>
 06_08__inlines__images__003:
   canonical: |
@@ -6902,21 +6902,21 @@
   static: |-
     <p data-sourcepos="1:1-1:26" dir="auto"><a class="no-attachment-icon" href="/url2" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" decoding="async" class="lazy" data-src="/url2"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url2" alt="foo bar" data-canonical-src="/url2"></p>
+    <p><img src="/url2" alt="foo bar" data-canonical-src="/url2"></p>
 06_08__inlines__images__004:
   canonical: |
     <p><img src="/url2" alt="foo bar" /></p>
   static: |-
     <p data-sourcepos="1:1-1:25" dir="auto"><a class="no-attachment-icon" href="/url2" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" decoding="async" class="lazy" data-src="/url2"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url2" alt="foo bar" data-canonical-src="/url2"></p>
+    <p><img src="/url2" alt="foo bar" data-canonical-src="/url2"></p>
 06_08__inlines__images__005:
   canonical: |
     <p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p>
   static: |-
     <p data-sourcepos="1:1-1:14" dir="auto"><a class="no-attachment-icon" href="train.jpg" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="train &amp; tracks" decoding="async" class="lazy" data-src="train.jpg"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/train.jpg" alt="foo bar" title="train &amp; tracks" data-canonical-src="train.jpg"></p>
+    <p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" data-canonical-src="train.jpg"></p>
     <pre>[foo *bar*]: train.jpg "train &amp; tracks"</pre>
 06_08__inlines__images__006:
   canonical: |
@@ -6924,7 +6924,7 @@
   static: |-
     <p data-sourcepos="1:1-1:20" dir="auto"><a class="no-attachment-icon" href="train.jpg" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="train &amp; tracks" decoding="async" class="lazy" data-src="train.jpg"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/train.jpg" alt="foo bar" title="train &amp; tracks" data-canonical-src="train.jpg"></p>
+    <p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" data-canonical-src="train.jpg"></p>
     <pre>[foobar]: train.jpg "train &amp; tracks"</pre>
 06_08__inlines__images__007:
   canonical: |
@@ -6932,35 +6932,35 @@
   static: |-
     <p data-sourcepos="1:1-1:17" dir="auto"><a class="no-attachment-icon" href="train.jpg" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" decoding="async" class="lazy" data-src="train.jpg"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/train.jpg" alt="foo" data-canonical-src="train.jpg"></p>
+    <p><img src="train.jpg" alt="foo" data-canonical-src="train.jpg"></p>
 06_08__inlines__images__008:
   canonical: |
     <p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p>
   static: |-
     <p data-sourcepos="1:1-1:45" dir="auto">My <a class="no-attachment-icon" href="/path/to/train.jpg" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="title" decoding="async" class="lazy" data-src="/path/to/train.jpg"></a></p>
   wysiwyg: |-
-    <p>My <img src="http://test.host/path/to/train.jpg" alt="foo bar" title="title" data-canonical-src="/path/to/train.jpg"></p>
+    <p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" data-canonical-src="/path/to/train.jpg"></p>
 06_08__inlines__images__009:
   canonical: |
     <p><img src="url" alt="foo" /></p>
   static: |-
     <p data-sourcepos="1:1-1:13" dir="auto"><a class="no-attachment-icon" href="url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" decoding="async" class="lazy" data-src="url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo" data-canonical-src="url"></p>
+    <p><img src="url" alt="foo" data-canonical-src="url"></p>
 06_08__inlines__images__010:
   canonical: |
     <p><img src="/url" alt="" /></p>
   static: |-
     <p data-sourcepos="1:1-1:9" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="" data-canonical-src="/url"></p>
 06_08__inlines__images__011:
   canonical: |
     <p><img src="/url" alt="foo" /></p>
   static: |-
     <p data-sourcepos="1:1-1:11" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="foo" data-canonical-src="/url"></p>
     <pre>[bar]: /url</pre>
 06_08__inlines__images__012:
   canonical: |
@@ -6968,7 +6968,7 @@
   static: |-
     <p data-sourcepos="1:1-1:11" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="foo" data-canonical-src="/url"></p>
     <pre>[bar]: /url</pre>
 06_08__inlines__images__013:
   canonical: |
@@ -6976,7 +6976,7 @@
   static: |-
     <p data-sourcepos="1:1-1:8" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo" title="title" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="foo" title="title" data-canonical-src="/url"></p>
     <pre>[foo]: /url "title"</pre>
 06_08__inlines__images__014:
   canonical: |
@@ -6984,7 +6984,7 @@
   static: |-
     <p data-sourcepos="1:1-1:14" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="title" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo bar" title="title" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="foo bar" title="title" data-canonical-src="/url"></p>
     <pre>[*foo* bar]: /url "title"</pre>
 06_08__inlines__images__015:
   canonical: |
@@ -6992,7 +6992,7 @@
   static: |-
     <p data-sourcepos="1:1-1:8" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="Foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="Foo" title="title" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="Foo" title="title" data-canonical-src="/url"></p>
     <pre>[foo]: /url "title"</pre>
 06_08__inlines__images__016:
   canonical: |
@@ -7002,7 +7002,7 @@
     <p data-sourcepos="1:1-2:2" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" title="title" decoding="async" class="lazy" data-src="/url"></a>
     []</p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo" title="title" data-canonical-src="/url">
+    <p><img src="/url" alt="foo" title="title" data-canonical-src="/url">
     []</p>
     <pre>[foo]: /url "title"</pre>
 06_08__inlines__images__017:
@@ -7011,7 +7011,7 @@
   static: |-
     <p data-sourcepos="1:1-1:6" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo" title="title" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="foo" title="title" data-canonical-src="/url"></p>
     <pre>[foo]: /url "title"</pre>
 06_08__inlines__images__018:
   canonical: |
@@ -7019,7 +7019,7 @@
   static: |-
     <p data-sourcepos="1:1-1:12" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="title" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="foo bar" title="title" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="foo bar" title="title" data-canonical-src="/url"></p>
     <pre>[*foo* bar]: /url "title"</pre>
 06_08__inlines__images__019:
   canonical: |
@@ -7037,7 +7037,7 @@
   static: |-
     <p data-sourcepos="1:1-1:6" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="Foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p>
   wysiwyg: |-
-    <p><img src="http://test.host/url" alt="Foo" title="title" data-canonical-src="/url"></p>
+    <p><img src="/url" alt="Foo" title="title" data-canonical-src="/url"></p>
     <pre>[foo]: /url "title"</pre>
 06_08__inlines__images__021:
   canonical: |
@@ -7053,7 +7053,7 @@
   static: |-
     <p data-sourcepos="1:1-1:27" dir="auto"><span>!</span><a href="/url" title="title">foo</a></p>
   wysiwyg: |-
-    <p>!<a target="_blank" rel="noopener noreferrer nofollow" href="http://test.host/url" title="title" canonicalsrc="/url">foo</a></p>
+    <p>!<a target="_blank" rel="noopener noreferrer nofollow" href="/url" title="title" canonicalsrc="/url">foo</a></p>
     <pre>[foo]: /url "title"</pre>
 06_09__inlines__autolinks__001:
   canonical: |
@@ -7061,7 +7061,7 @@
   static: |-
     <p data-sourcepos="1:1-1:20" dir="auto"><a href="http://foo.bar.baz" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar.baz</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://foo.bar.baz/" canonicalsrc="http://foo.bar.baz">http://foo.bar.baz</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://foo.bar.baz" canonicalsrc="http://foo.bar.baz">http://foo.bar.baz</a></p>
 06_09__inlines__autolinks__002:
   canonical: |
     <p><a href="http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean">http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p>
@@ -7075,28 +7075,28 @@
   static: |-
     <p data-sourcepos="1:1-1:24" dir="auto"><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="irc://foo.bar:2233/baz" canonicalsrc="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow">irc://foo.bar:2233/baz</a></p>
 06_09__inlines__autolinks__004:
   canonical: |
     <p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p>
   static: |-
     <p data-sourcepos="1:1-1:20" dir="auto"><a href="mailto:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="mailto:FOO@BAR.BAZ" canonicalsrc="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="MAILTO:FOO@BAR.BAZ" canonicalsrc="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p>
 06_09__inlines__autolinks__005:
   canonical: |
     <p><a href="a+b+c:d">a+b+c:d</a></p>
   static: |-
     <p data-sourcepos="1:1-1:9" dir="auto"><a href="a+b+c:d">a+b+c:d</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="a+b+c:d" canonicalsrc="a+b+c:d">a+b+c:d</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow">a+b+c:d</a></p>
 06_09__inlines__autolinks__006:
   canonical: |
     <p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p>
   static: |-
     <p data-sourcepos="1:1-1:26" dir="auto"><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="made-up-scheme://foo,bar" canonicalsrc="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow">made-up-scheme://foo,bar</a></p>
 06_09__inlines__autolinks__007:
   canonical: |
     <p><a href="http://../">http://../</a></p>
@@ -7110,7 +7110,7 @@
   static: |-
     <p data-sourcepos="1:1-1:20" dir="auto"><a href="localhost:5001/foo">localhost:5001/foo</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="localhost:5001/foo" canonicalsrc="localhost:5001/foo">localhost:5001/foo</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow">localhost:5001/foo</a></p>
 06_09__inlines__autolinks__009:
   canonical: |
     <p>&lt;http://foo.bar/baz bim&gt;</p>
@@ -7159,7 +7159,7 @@
   static: |-
     <p data-sourcepos="1:1-1:18" dir="auto">&lt; <a href="http://foo.bar" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar</a> &gt;</p>
   wysiwyg: |-
-    <p>&lt; <a target="_blank" rel="noopener noreferrer nofollow" href="http://foo.bar/" canonicalsrc="http://foo.bar">http://foo.bar</a> &gt;</p>
+    <p>&lt; <a target="_blank" rel="noopener noreferrer nofollow" href="http://foo.bar" canonicalsrc="http://foo.bar">http://foo.bar</a> &gt;</p>
 06_09__inlines__autolinks__016:
   canonical: |
     <p>&lt;m:abc&gt;</p>
@@ -7180,7 +7180,7 @@
   static: |-
     <p data-sourcepos="1:1-1:18" dir="auto"><a href="http://example.com" rel="nofollow noreferrer noopener" target="_blank">http://example.com</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://example.com/" canonicalsrc="http://example.com">http://example.com</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://example.com" canonicalsrc="http://example.com">http://example.com</a></p>
 06_09__inlines__autolinks__019:
   canonical: |
     <p>foo@bar.example.com</p>
@@ -7194,7 +7194,7 @@
   static: |-
     <p data-sourcepos="1:1-1:18" dir="auto"><a href="http://www.commonmark.org" rel="nofollow noreferrer noopener" target="_blank">www.commonmark.org</a></p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://www.commonmark.org/" canonicalsrc="http://www.commonmark.org">www.commonmark.org</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://www.commonmark.org" canonicalsrc="http://www.commonmark.org">www.commonmark.org</a></p>
 06_10__inlines__autolinks_extension__002:
   canonical: |
     <p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p>
@@ -7210,7 +7210,7 @@
     <p data-sourcepos="1:1-1:25" dir="auto">Visit <a href="http://www.commonmark.org" rel="nofollow noreferrer noopener" target="_blank">www.commonmark.org</a>.</p>
     <p data-sourcepos="3:1-3:29" dir="auto">Visit <a href="http://www.commonmark.org/a.b" rel="nofollow noreferrer noopener" target="_blank">www.commonmark.org/a.b</a>.</p>
   wysiwyg: |-
-    <p>Visit <a target="_blank" rel="noopener noreferrer nofollow" href="http://www.commonmark.org/" canonicalsrc="http://www.commonmark.org">www.commonmark.org</a>.</p>
+    <p>Visit <a target="_blank" rel="noopener noreferrer nofollow" href="http://www.commonmark.org" canonicalsrc="http://www.commonmark.org">www.commonmark.org</a>.</p>
     <p>Visit <a target="_blank" rel="noopener noreferrer nofollow" href="http://www.commonmark.org/a.b" canonicalsrc="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p>
 06_10__inlines__autolinks_extension__004:
   canonical: |
@@ -7262,7 +7262,7 @@
     <p data-sourcepos="3:1-3:63" dir="auto">(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)" rel="nofollow noreferrer noopener" target="_blank">https://encrypted.google.com/search?q=Markup+(business)</a>)</p>
     <p data-sourcepos="5:1-5:48" dir="auto">Anonymous FTP is available at <a href="ftp://foo.bar.baz/">ftp://foo.bar.baz</a>.</p>
   wysiwyg: |-
-    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://commonmark.org/" canonicalsrc="http://commonmark.org">http://commonmark.org</a></p>
+    <p><a target="_blank" rel="noopener noreferrer nofollow" href="http://commonmark.org" canonicalsrc="http://commonmark.org">http://commonmark.org</a></p>
     <p>(Visit <a target="_blank" rel="noopener noreferrer nofollow" href="https://encrypted.google.com/search?q=Markup+(business)" canonicalsrc="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p>
     <p>Anonymous FTP is available at ftp://foo.bar.baz.</p>
 06_10__inlines__autolinks_extension__009:
diff --git a/glfm_specification/example_snapshots/prosemirror_json.yml b/glfm_specification/example_snapshots/prosemirror_json.yml
index 73fcef4dbc09..7f08d4e4a1d7 100644
--- a/glfm_specification/example_snapshots/prosemirror_json.yml
+++ b/glfm_specification/example_snapshots/prosemirror_json.yml
@@ -3145,7 +3145,7 @@
                   {
                     "type": "link",
                     "attrs": {
-                      "href": "http://test.host/bar",
+                      "href": "bar",
                       "target": "_blank",
                       "class": null,
                       "title": null,
@@ -3230,7 +3230,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/foo",
+                  "href": "foo",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -3748,7 +3748,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/bar",
+                  "href": "bar",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -3906,7 +3906,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -3947,7 +3947,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "the title",
@@ -3988,7 +3988,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/my_(url)",
+                  "href": "my_(url)",
                   "target": "_blank",
                   "class": null,
                   "title": "title (with parens)",
@@ -4029,7 +4029,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/my%20url",
+                  "href": "my%20url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -4070,7 +4070,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "\ntitle\nline1\nline2\n",
@@ -4144,7 +4144,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4274,7 +4274,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url%5Cbar*baz",
+                  "href": "/url%5Cbar*baz",
                   "target": "_blank",
                   "class": null,
                   "title": "foo\"bar\\baz",
@@ -4301,7 +4301,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4342,7 +4342,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/first",
+                  "href": "first",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4411,7 +4411,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4452,7 +4452,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/%CF%86%CE%BF%CF%85",
+                  "href": "/%CF%86%CE%BF%CF%85",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4655,7 +4655,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4739,7 +4739,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4784,7 +4784,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4853,7 +4853,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/foo-url",
+                  "href": "/foo-url",
                   "target": "_blank",
                   "class": null,
                   "title": "foo",
@@ -4873,7 +4873,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/bar-url",
+                  "href": "/bar-url",
                   "target": "_blank",
                   "class": null,
                   "title": "bar",
@@ -4893,7 +4893,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/baz-url",
+                  "href": "/baz-url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -4920,7 +4920,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -10683,7 +10683,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://example.com/?find=%5C*",
+                  "href": "http://example.com?find=%5C*",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -10719,7 +10719,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/bar*",
+                  "href": "/bar*",
                   "target": "_blank",
                   "class": null,
                   "title": "ti*tle",
@@ -10746,7 +10746,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/bar*",
+                  "href": "/bar*",
                   "target": "_blank",
                   "class": null,
                   "title": "ti*tle",
@@ -10905,7 +10905,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/f%C3%B6%C3%B6",
+                  "href": "/f%C3%B6%C3%B6",
                   "target": "_blank",
                   "class": null,
                   "title": "föö",
@@ -10932,7 +10932,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/f%C3%B6%C3%B6",
+                  "href": "/f%C3%B6%C3%B6",
                   "target": "_blank",
                   "class": null,
                   "title": "föö",
@@ -11466,7 +11466,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/%60",
+                  "href": "`",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -11517,7 +11517,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://foo.bar.`baz/",
+                  "href": "http://foo.bar.%60baz",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -12673,7 +12673,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -13143,7 +13143,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -13212,7 +13212,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -13571,7 +13571,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -14477,7 +14477,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -14508,7 +14508,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -14536,7 +14536,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/foo",
+              "src": "foo",
               "alt": null,
               "title": "*",
               "uploading": false,
@@ -14764,7 +14764,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -14791,7 +14791,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -14887,7 +14887,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/my%20uri",
+                  "href": "/my%20uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -14944,7 +14944,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/b)c",
+                  "href": "b)c",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15010,7 +15010,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/(foo)",
+                  "href": "(foo)",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15037,7 +15037,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/foo(and(bar))",
+                  "href": "foo(and(bar))",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15064,7 +15064,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/foo(and(bar)",
+                  "href": "foo(and(bar)",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15091,7 +15091,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/foo(and(bar)",
+                  "href": "foo(and(bar)",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15118,7 +15118,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/foo):",
+                  "href": "foo):",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15145,7 +15145,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/#fragment",
+                  "href": "#fragment",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15166,7 +15166,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://example.com/#fragment",
+                  "href": "http://example.com#fragment",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15187,7 +15187,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://example.com/?foo=3#frag",
+                  "href": "http://example.com?foo=3#frag",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15214,7 +15214,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/foo%5Cbar",
+                  "href": "foo%5Cbar",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15241,7 +15241,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/foo%20b%C3%A4",
+                  "href": "foo%20b%C3%A4",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15268,7 +15268,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/%22title%22",
+                  "href": "%22title%22",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15295,7 +15295,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -15322,7 +15322,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title \"\"",
@@ -15349,7 +15349,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url%C2%A0%22title%22",
+                  "href": "/url%C2%A0%22title%22",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15391,7 +15391,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title \"and\" title",
@@ -15418,7 +15418,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -15460,7 +15460,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15506,7 +15506,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15533,7 +15533,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15560,7 +15560,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15576,7 +15576,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15595,7 +15595,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15617,7 +15617,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15650,7 +15650,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/moon.jpg",
+              "src": "moon.jpg",
               "alt": "moon",
               "title": null,
               "uploading": false,
@@ -15660,7 +15660,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15690,7 +15690,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15734,7 +15734,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15774,7 +15774,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/uri3",
+              "src": "uri3",
               "alt": "[foo](uri2)",
               "title": null,
               "uploading": false,
@@ -15802,7 +15802,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15829,7 +15829,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/baz*",
+                  "href": "baz*",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -15950,7 +15950,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -15991,7 +15991,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16032,7 +16032,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16073,7 +16073,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16089,7 +16089,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16108,7 +16108,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16130,7 +16130,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16177,7 +16177,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/moon.jpg",
+              "src": "moon.jpg",
               "alt": "moon",
               "title": null,
               "uploading": false,
@@ -16187,7 +16187,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16231,7 +16231,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16251,7 +16251,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16305,7 +16305,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16328,7 +16328,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16373,7 +16373,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16414,7 +16414,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16567,7 +16567,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -16608,7 +16608,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16667,7 +16667,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16698,7 +16698,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -16743,7 +16743,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -16812,7 +16812,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url1",
+                  "href": "/url1",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16940,7 +16940,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -16995,7 +16995,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/uri",
+                  "href": "/uri",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17070,7 +17070,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17111,7 +17111,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17130,7 +17130,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17171,7 +17171,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17212,7 +17212,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17257,7 +17257,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17298,7 +17298,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17317,7 +17317,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17362,7 +17362,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17381,7 +17381,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17430,7 +17430,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17471,7 +17471,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -17512,7 +17512,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17604,7 +17604,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17631,7 +17631,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url2",
+                  "href": "/url2",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17686,7 +17686,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url1",
+                  "href": "/url1",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17768,7 +17768,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url1",
+                  "href": "/url1",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17817,7 +17817,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17858,7 +17858,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url2",
+                  "href": "/url2",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17874,7 +17874,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url1",
+                  "href": "/url1",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17933,7 +17933,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url1",
+                  "href": "/url1",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -17985,7 +17985,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "foo",
               "title": "title",
               "uploading": false,
@@ -18006,7 +18006,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/train.jpg",
+              "src": "train.jpg",
               "alt": "foo bar",
               "title": "train & tracks",
               "uploading": false,
@@ -18041,7 +18041,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url2",
+              "src": "/url2",
               "alt": "foo bar",
               "title": null,
               "uploading": false,
@@ -18062,7 +18062,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url2",
+              "src": "/url2",
               "alt": "foo bar",
               "title": null,
               "uploading": false,
@@ -18083,7 +18083,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/train.jpg",
+              "src": "train.jpg",
               "alt": "foo bar",
               "title": "train & tracks",
               "uploading": false,
@@ -18118,7 +18118,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/train.jpg",
+              "src": "train.jpg",
               "alt": "foo bar",
               "title": "train & tracks",
               "uploading": false,
@@ -18153,7 +18153,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/train.jpg",
+              "src": "train.jpg",
               "alt": "foo",
               "title": null,
               "uploading": false,
@@ -18178,7 +18178,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/path/to/train.jpg",
+              "src": "/path/to/train.jpg",
               "alt": "foo bar",
               "title": "title",
               "uploading": false,
@@ -18199,7 +18199,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "url",
               "alt": "foo",
               "title": null,
               "uploading": false,
@@ -18220,7 +18220,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "",
               "title": null,
               "uploading": false,
@@ -18241,7 +18241,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "foo",
               "title": null,
               "uploading": false,
@@ -18276,7 +18276,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "foo",
               "title": null,
               "uploading": false,
@@ -18311,7 +18311,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "foo",
               "title": "title",
               "uploading": false,
@@ -18346,7 +18346,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "foo bar",
               "title": "title",
               "uploading": false,
@@ -18381,7 +18381,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "Foo",
               "title": "title",
               "uploading": false,
@@ -18416,7 +18416,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "foo",
               "title": "title",
               "uploading": false,
@@ -18455,7 +18455,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "foo",
               "title": "title",
               "uploading": false,
@@ -18490,7 +18490,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "foo bar",
               "title": "title",
               "uploading": false,
@@ -18549,7 +18549,7 @@
           {
             "type": "image",
             "attrs": {
-              "src": "http://test.host/url",
+              "src": "/url",
               "alt": "Foo",
               "title": "title",
               "uploading": false,
@@ -18620,7 +18620,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://test.host/url",
+                  "href": "/url",
                   "target": "_blank",
                   "class": null,
                   "title": "title",
@@ -18661,7 +18661,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://foo.bar.baz/",
+                  "href": "http://foo.bar.baz",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -18715,11 +18715,11 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "irc://foo.bar:2233/baz",
+                  "href": null,
                   "target": "_blank",
                   "class": null,
                   "title": null,
-                  "canonicalSrc": "irc://foo.bar:2233/baz"
+                  "canonicalSrc": null
                 }
               }
             ],
@@ -18742,7 +18742,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "mailto:FOO@BAR.BAZ",
+                  "href": "MAILTO:FOO@BAR.BAZ",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -18769,11 +18769,11 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "a+b+c:d",
+                  "href": null,
                   "target": "_blank",
                   "class": null,
                   "title": null,
-                  "canonicalSrc": "a+b+c:d"
+                  "canonicalSrc": null
                 }
               }
             ],
@@ -18796,11 +18796,11 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "made-up-scheme://foo,bar",
+                  "href": null,
                   "target": "_blank",
                   "class": null,
                   "title": null,
-                  "canonicalSrc": "made-up-scheme://foo,bar"
+                  "canonicalSrc": null
                 }
               }
             ],
@@ -18850,11 +18850,11 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "localhost:5001/foo",
+                  "href": null,
                   "target": "_blank",
                   "class": null,
                   "title": null,
-                  "canonicalSrc": "localhost:5001/foo"
+                  "canonicalSrc": null
                 }
               }
             ],
@@ -19047,7 +19047,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://foo.bar/",
+                  "href": "http://foo.bar",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -19108,7 +19108,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://example.com/",
+                  "href": "http://example.com",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -19162,7 +19162,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://www.commonmark.org/",
+                  "href": "http://www.commonmark.org",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -19228,7 +19228,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://www.commonmark.org/",
+                  "href": "http://www.commonmark.org",
                   "target": "_blank",
                   "class": null,
                   "title": null,
@@ -19504,7 +19504,7 @@
               {
                 "type": "link",
                 "attrs": {
-                  "href": "http://commonmark.org/",
+                  "href": "http://commonmark.org",
                   "target": "_blank",
                   "class": null,
                   "title": null,
diff --git a/spec/frontend/content_editor/remark_markdown_processing_spec.js b/spec/frontend/content_editor/remark_markdown_processing_spec.js
index ca5526442586..0f9073dc26d3 100644
--- a/spec/frontend/content_editor/remark_markdown_processing_spec.js
+++ b/spec/frontend/content_editor/remark_markdown_processing_spec.js
@@ -261,7 +261,7 @@ describe('Client side Markdown processing', () => {
             ...source('<img src="bar" alt="foo" />'),
             alt: 'foo',
             canonicalSrc: 'bar',
-            src: 'http://test.host/bar',
+            src: 'bar',
           }),
         ),
       ),
@@ -283,7 +283,7 @@ describe('Client side Markdown processing', () => {
           image({
             ...source('<img src="bar" alt="foo" />'),
             alt: 'foo',
-            src: 'http://test.host/bar',
+            src: 'bar',
             canonicalSrc: 'bar',
           }),
         ),
@@ -297,7 +297,7 @@ describe('Client side Markdown processing', () => {
           link(
             {
               ...source('[GitLab](https://gitlab.com "Go to GitLab")'),
-              href: 'https://gitlab.com/',
+              href: 'https://gitlab.com',
               canonicalSrc: 'https://gitlab.com',
               title: 'Go to GitLab',
             },
@@ -316,7 +316,7 @@ describe('Client side Markdown processing', () => {
             link(
               {
                 ...source('[GitLab](https://gitlab.com "Go to GitLab")'),
-                href: 'https://gitlab.com/',
+                href: 'https://gitlab.com',
                 canonicalSrc: 'https://gitlab.com',
                 title: 'Go to GitLab',
               },
@@ -335,7 +335,7 @@ describe('Client side Markdown processing', () => {
             {
               ...source('www.commonmark.org'),
               canonicalSrc: 'http://www.commonmark.org',
-              href: 'http://www.commonmark.org/',
+              href: 'http://www.commonmark.org',
             },
             'www.commonmark.org',
           ),
@@ -389,7 +389,7 @@ describe('Client side Markdown processing', () => {
               sourceMapKey: null,
               sourceMarkdown: null,
               canonicalSrc: 'https://gitlab.com',
-              href: 'https://gitlab.com/',
+              href: 'https://gitlab.com',
             },
             'https://gitlab.com',
           ),
@@ -616,7 +616,7 @@ two
                 ...source('![bar](foo.png)'),
                 alt: 'bar',
                 canonicalSrc: 'foo.png',
-                src: 'http://test.host/foo.png',
+                src: 'foo.png',
               }),
             ),
           ),
@@ -969,12 +969,12 @@ Paragraph
             {
               ...source('[![moon](moon.jpg)](/uri)'),
               canonicalSrc: '/uri',
-              href: 'http://test.host/uri',
+              href: '/uri',
             },
             image({
               ...source('![moon](moon.jpg)'),
               canonicalSrc: 'moon.jpg',
-              src: 'http://test.host/moon.jpg',
+              src: 'moon.jpg',
               alt: 'moon',
             }),
           ),
@@ -1010,7 +1010,7 @@ Paragraph
               {
                 ...source('[moon](moon.jpg)'),
                 canonicalSrc: 'moon.jpg',
-                href: 'http://test.host/moon.jpg',
+                href: 'moon.jpg',
               },
               'moon',
             ),
@@ -1021,7 +1021,7 @@ Paragraph
             link(
               {
                 ...source('[sun](sun.jpg)'),
-                href: 'http://test.host/sun.jpg',
+                href: 'sun.jpg',
                 canonicalSrc: 'sun.jpg',
               },
               'sun',
@@ -1141,7 +1141,7 @@ _world_.
           link(
             {
               ...source('[GitLab][gitlab-url]'),
-              href: 'https://gitlab.com/',
+              href: 'https://gitlab.com',
               canonicalSrc: 'https://gitlab.com',
               title: 'GitLab',
             },
@@ -1235,4 +1235,72 @@ body {
       expect(tiptapEditor.getHTML()).toEqual(expectedHtml);
     },
   );
+
+  describe('attribute sanitization', () => {
+    // eslint-disable-next-line no-script-url
+    const protocolBasedInjectionSimpleNoSpaces = "javascript:alert('XSS');";
+    // eslint-disable-next-line no-script-url
+    const protocolBasedInjectionSimpleSpacesBefore = "javascript:    alert('XSS');";
+
+    const docWithImageFactory = (urlInput, urlOutput) => {
+      const input = `<img src="${urlInput}">`;
+
+      return {
+        input,
+        expectedDoc: doc(
+          paragraph(
+            source(input),
+            image({
+              ...source(input),
+              src: urlOutput,
+              canonicalSrc: urlOutput,
+            }),
+          ),
+        ),
+      };
+    };
+
+    const docWithLinkFactory = (urlInput, urlOutput) => {
+      const input = `<a href="${urlInput}">foo</a>`;
+
+      return {
+        input,
+        expectedDoc: doc(
+          paragraph(
+            source(input),
+            link({ ...source(input), href: urlOutput, canonicalSrc: urlOutput }, 'foo'),
+          ),
+        ),
+      };
+    };
+
+    it.each`
+      desc                                                                     | urlInput                                                                                                                                                                                                             | urlOutput
+      ${'protocol-based JS injection: simple, no spaces'}                      | ${protocolBasedInjectionSimpleNoSpaces}                                                                                                                                                                              | ${null}
+      ${'protocol-based JS injection: simple, spaces before'}                  | ${"javascript    :alert('XSS');"}                                                                                                                                                                                    | ${null}
+      ${'protocol-based JS injection: simple, spaces after'}                   | ${protocolBasedInjectionSimpleSpacesBefore}                                                                                                                                                                          | ${null}
+      ${'protocol-based JS injection: simple, spaces before and after'}        | ${"javascript    :   alert('XSS');"}                                                                                                                                                                                 | ${null}
+      ${'protocol-based JS injection: UTF-8 encoding'}                         | ${'javascript&#58;'}                                                                                                                                                                                                 | ${null}
+      ${'protocol-based JS injection: long UTF-8 encoding'}                    | ${'javascript&#0058;'}                                                                                                                                                                                               | ${null}
+      ${'protocol-based JS injection: long UTF-8 encoding without semicolons'} | ${'&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041'} | ${null}
+      ${'protocol-based JS injection: hex encoding'}                           | ${'javascript&#x3A;'}                                                                                                                                                                                                | ${null}
+      ${'protocol-based JS injection: long hex encoding'}                      | ${'javascript&#x003A;'}                                                                                                                                                                                              | ${null}
+      ${'protocol-based JS injection: hex encoding without semicolons'}        | ${'&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29'}                                                                                             | ${null}
+      ${'protocol-based JS injection: Unicode'}                                | ${"\u0001java\u0003script:alert('XSS')"}                                                                                                                                                                             | ${null}
+      ${'protocol-based JS injection: spaces and entities'}                    | ${"&#14;  javascript:alert('XSS');"}                                                                                                                                                                                 | ${null}
+      ${'vbscript'}                                                            | ${'vbscript:alert(document.domain)'}                                                                                                                                                                                 | ${null}
+      ${'protocol-based JS injection: preceding colon'}                        | ${":javascript:alert('XSS');"}                                                                                                                                                                                       | ${":javascript:alert('XSS');"}
+      ${'protocol-based JS injection: null char'}                              | ${"java\0script:alert('XSS')"}                                                                                                                                                                                       | ${"java�script:alert('XSS')"}
+      ${'protocol-based JS injection: invalid URL char'}                       | ${"java\\script:alert('XSS')"}                                                                                                                                                                                       | ${"java\\script:alert('XSS')"}
+    `('sanitize $desc:\n\tURL "$urlInput" becomes "$urlOutput"', ({ urlInput, urlOutput }) => {
+      const exampleFactories = [docWithImageFactory, docWithLinkFactory];
+
+      exampleFactories.forEach(async (exampleFactory) => {
+        const { input, expectedDoc } = exampleFactory(urlInput, urlOutput);
+        const document = await deserialize(input);
+
+        expect(document.toJSON()).toEqual(expectedDoc.toJSON());
+      });
+    });
+  });
 });
diff --git a/spec/frontend/content_editor/services/markdown_serializer_spec.js b/spec/frontend/content_editor/services/markdown_serializer_spec.js
index 55f17727df7f..37fe24821230 100644
--- a/spec/frontend/content_editor/services/markdown_serializer_spec.js
+++ b/spec/frontend/content_editor/services/markdown_serializer_spec.js
@@ -1213,47 +1213,47 @@ paragraph
   };
 
   it.each`
-    mark                   | markdown                                        | modifiedMarkdown                                                              | editAction
-    ${'bold'}              | ${'**bold**'}                                   | ${'**bold modified**'}                                                        | ${defaultEditAction}
-    ${'bold'}              | ${'__bold__'}                                   | ${'__bold modified__'}                                                        | ${defaultEditAction}
-    ${'bold'}              | ${'<strong>bold</strong>'}                      | ${'<strong>bold modified</strong>'}                                           | ${defaultEditAction}
-    ${'bold'}              | ${'<b>bold</b>'}                                | ${'<b>bold modified</b>'}                                                     | ${defaultEditAction}
-    ${'italic'}            | ${'_italic_'}                                   | ${'_italic modified_'}                                                        | ${defaultEditAction}
-    ${'italic'}            | ${'*italic*'}                                   | ${'*italic modified*'}                                                        | ${defaultEditAction}
-    ${'italic'}            | ${'<em>italic</em>'}                            | ${'<em>italic modified</em>'}                                                 | ${defaultEditAction}
-    ${'italic'}            | ${'<i>italic</i>'}                              | ${'<i>italic modified</i>'}                                                   | ${defaultEditAction}
-    ${'link'}              | ${'[gitlab](https://gitlab.com)'}               | ${'[gitlab modified](https://gitlab.com)'}                                    | ${defaultEditAction}
-    ${'link'}              | ${'<a href="https://gitlab.com">link</a>'}      | ${'<a href="https://gitlab.com/">link modified</a>'}                          | ${defaultEditAction}
-    ${'link'}              | ${'link www.gitlab.com'}                        | ${'modified link www.gitlab.com'}                                             | ${prependContentEditAction}
-    ${'link'}              | ${'link https://www.gitlab.com'}                | ${'modified link https://www.gitlab.com'}                                     | ${prependContentEditAction}
-    ${'link'}              | ${'link(https://www.gitlab.com)'}               | ${'modified link(https://www.gitlab.com)'}                                    | ${prependContentEditAction}
-    ${'link'}              | ${'link(engineering@gitlab.com)'}               | ${'modified link(engineering@gitlab.com)'}                                    | ${prependContentEditAction}
-    ${'link'}              | ${'link <https://www.gitlab.com>'}              | ${'modified link <https://www.gitlab.com>'}                                   | ${prependContentEditAction}
-    ${'link'}              | ${'link [https://www.gitlab.com>'}              | ${'modified link \\[https://www.gitlab.com>'}                                 | ${prependContentEditAction}
-    ${'link'}              | ${'link <https://www.gitlab.com'}               | ${'modified link <https://www.gitlab.com'}                                    | ${prependContentEditAction}
-    ${'link'}              | ${'link https://www.gitlab.com>'}               | ${'modified link [https://www.gitlab.com>](https://www.gitlab.com%3E)'}       | ${prependContentEditAction}
-    ${'link'}              | ${'link https://www.gitlab.com/path'}           | ${'modified link https://www.gitlab.com/path'}                                | ${prependContentEditAction}
-    ${'link'}              | ${'link https://www.gitlab.com?query=search'}   | ${'modified link https://www.gitlab.com?query=search'}                        | ${prependContentEditAction}
-    ${'link'}              | ${'link https://www.gitlab.com/#fragment'}      | ${'modified link https://www.gitlab.com/#fragment'}                           | ${prependContentEditAction}
-    ${'link'}              | ${'link https://www.gitlab.com/?query=search'}  | ${'modified link https://www.gitlab.com/?query=search'}                       | ${prependContentEditAction}
-    ${'link'}              | ${'link https://www.gitlab.com#fragment'}       | ${'modified link https://www.gitlab.com#fragment'}                            | ${prependContentEditAction}
-    ${'link'}              | ${'link **https://www.gitlab.com]**'}           | ${'modified link [**https://www.gitlab.com\\]**](https://www.gitlab.com%5D)'} | ${prependContentEditAction}
-    ${'code'}              | ${'`code`'}                                     | ${'`code modified`'}                                                          | ${defaultEditAction}
-    ${'code'}              | ${'<code>code</code>'}                          | ${'<code>code modified</code>'}                                               | ${defaultEditAction}
-    ${'strike'}            | ${'~~striked~~'}                                | ${'~~striked modified~~'}                                                     | ${defaultEditAction}
-    ${'strike'}            | ${'<del>striked</del>'}                         | ${'<del>striked modified</del>'}                                              | ${defaultEditAction}
-    ${'strike'}            | ${'<strike>striked</strike>'}                   | ${'<strike>striked modified</strike>'}                                        | ${defaultEditAction}
-    ${'strike'}            | ${'<s>striked</s>'}                             | ${'<s>striked modified</s>'}                                                  | ${defaultEditAction}
-    ${'list'}              | ${'- list item'}                                | ${'- list item modified'}                                                     | ${defaultEditAction}
-    ${'list'}              | ${'* list item'}                                | ${'* list item modified'}                                                     | ${defaultEditAction}
-    ${'list'}              | ${'+ list item'}                                | ${'+ list item modified'}                                                     | ${defaultEditAction}
-    ${'list'}              | ${'- list item 1\n- list item 2'}               | ${'- list item 1\n- list item 2 modified'}                                    | ${defaultEditAction}
-    ${'list'}              | ${'2) list item'}                               | ${'2) list item modified'}                                                    | ${defaultEditAction}
-    ${'list'}              | ${'1. list item'}                               | ${'1. list item modified'}                                                    | ${defaultEditAction}
-    ${'taskList'}          | ${'2) [ ] task list item'}                      | ${'2) [ ] task list item modified'}                                           | ${defaultEditAction}
-    ${'taskList'}          | ${'2) [x] task list item'}                      | ${'2) [x] task list item modified'}                                           | ${defaultEditAction}
-    ${'image'}             | ${'![image](image.png)'}                        | ${'![image](image.png) modified'}                                             | ${defaultEditAction}
-    ${'footnoteReference'} | ${'[^1] footnote\n\n[^1]: footnote definition'} | ${'modified [^1] footnote\n\n[^1]: footnote definition'}                      | ${prependContentEditAction}
+    mark                   | markdown                                        | modifiedMarkdown                                         | editAction
+    ${'bold'}              | ${'**bold**'}                                   | ${'**bold modified**'}                                   | ${defaultEditAction}
+    ${'bold'}              | ${'__bold__'}                                   | ${'__bold modified__'}                                   | ${defaultEditAction}
+    ${'bold'}              | ${'<strong>bold</strong>'}                      | ${'<strong>bold modified</strong>'}                      | ${defaultEditAction}
+    ${'bold'}              | ${'<b>bold</b>'}                                | ${'<b>bold modified</b>'}                                | ${defaultEditAction}
+    ${'italic'}            | ${'_italic_'}                                   | ${'_italic modified_'}                                   | ${defaultEditAction}
+    ${'italic'}            | ${'*italic*'}                                   | ${'*italic modified*'}                                   | ${defaultEditAction}
+    ${'italic'}            | ${'<em>italic</em>'}                            | ${'<em>italic modified</em>'}                            | ${defaultEditAction}
+    ${'italic'}            | ${'<i>italic</i>'}                              | ${'<i>italic modified</i>'}                              | ${defaultEditAction}
+    ${'link'}              | ${'[gitlab](https://gitlab.com)'}               | ${'[gitlab modified](https://gitlab.com)'}               | ${defaultEditAction}
+    ${'link'}              | ${'<a href="https://gitlab.com">link</a>'}      | ${'<a href="https://gitlab.com">link modified</a>'}      | ${defaultEditAction}
+    ${'link'}              | ${'link www.gitlab.com'}                        | ${'modified link www.gitlab.com'}                        | ${prependContentEditAction}
+    ${'link'}              | ${'link https://www.gitlab.com'}                | ${'modified link https://www.gitlab.com'}                | ${prependContentEditAction}
+    ${'link'}              | ${'link(https://www.gitlab.com)'}               | ${'modified link(https://www.gitlab.com)'}               | ${prependContentEditAction}
+    ${'link'}              | ${'link(engineering@gitlab.com)'}               | ${'modified link(engineering@gitlab.com)'}               | ${prependContentEditAction}
+    ${'link'}              | ${'link <https://www.gitlab.com>'}              | ${'modified link <https://www.gitlab.com>'}              | ${prependContentEditAction}
+    ${'link'}              | ${'link [https://www.gitlab.com>'}              | ${'modified link \\[https://www.gitlab.com>'}            | ${prependContentEditAction}
+    ${'link'}              | ${'link <https://www.gitlab.com'}               | ${'modified link <https://www.gitlab.com'}               | ${prependContentEditAction}
+    ${'link'}              | ${'link https://www.gitlab.com>'}               | ${'modified link https://www.gitlab.com>'}               | ${prependContentEditAction}
+    ${'link'}              | ${'link https://www.gitlab.com/path'}           | ${'modified link https://www.gitlab.com/path'}           | ${prependContentEditAction}
+    ${'link'}              | ${'link https://www.gitlab.com?query=search'}   | ${'modified link https://www.gitlab.com?query=search'}   | ${prependContentEditAction}
+    ${'link'}              | ${'link https://www.gitlab.com/#fragment'}      | ${'modified link https://www.gitlab.com/#fragment'}      | ${prependContentEditAction}
+    ${'link'}              | ${'link https://www.gitlab.com/?query=search'}  | ${'modified link https://www.gitlab.com/?query=search'}  | ${prependContentEditAction}
+    ${'link'}              | ${'link https://www.gitlab.com#fragment'}       | ${'modified link https://www.gitlab.com#fragment'}       | ${prependContentEditAction}
+    ${'link'}              | ${'link **https://www.gitlab.com]**'}           | ${'modified link **https://www.gitlab.com\\]**'}         | ${prependContentEditAction}
+    ${'code'}              | ${'`code`'}                                     | ${'`code modified`'}                                     | ${defaultEditAction}
+    ${'code'}              | ${'<code>code</code>'}                          | ${'<code>code modified</code>'}                          | ${defaultEditAction}
+    ${'strike'}            | ${'~~striked~~'}                                | ${'~~striked modified~~'}                                | ${defaultEditAction}
+    ${'strike'}            | ${'<del>striked</del>'}                         | ${'<del>striked modified</del>'}                         | ${defaultEditAction}
+    ${'strike'}            | ${'<strike>striked</strike>'}                   | ${'<strike>striked modified</strike>'}                   | ${defaultEditAction}
+    ${'strike'}            | ${'<s>striked</s>'}                             | ${'<s>striked modified</s>'}                             | ${defaultEditAction}
+    ${'list'}              | ${'- list item'}                                | ${'- list item modified'}                                | ${defaultEditAction}
+    ${'list'}              | ${'* list item'}                                | ${'* list item modified'}                                | ${defaultEditAction}
+    ${'list'}              | ${'+ list item'}                                | ${'+ list item modified'}                                | ${defaultEditAction}
+    ${'list'}              | ${'- list item 1\n- list item 2'}               | ${'- list item 1\n- list item 2 modified'}               | ${defaultEditAction}
+    ${'list'}              | ${'2) list item'}                               | ${'2) list item modified'}                               | ${defaultEditAction}
+    ${'list'}              | ${'1. list item'}                               | ${'1. list item modified'}                               | ${defaultEditAction}
+    ${'taskList'}          | ${'2) [ ] task list item'}                      | ${'2) [ ] task list item modified'}                      | ${defaultEditAction}
+    ${'taskList'}          | ${'2) [x] task list item'}                      | ${'2) [x] task list item modified'}                      | ${defaultEditAction}
+    ${'image'}             | ${'![image](image.png)'}                        | ${'![image](image.png) modified'}                        | ${defaultEditAction}
+    ${'footnoteReference'} | ${'[^1] footnote\n\n[^1]: footnote definition'} | ${'modified [^1] footnote\n\n[^1]: footnote definition'} | ${prependContentEditAction}
   `(
     'preserves original $mark syntax when sourceMarkdown is available for $markdown',
     async ({ markdown, modifiedMarkdown, editAction }) => {
-- 
GitLab