shithub: hugo

Download patch

ref: c154c2f7b2a6703dbde7f6bd2a1817a39c6fd2ea
parent: 075b17ee1d621e0ebbcecf1063f8f68a00ac221a
author: Berin Larson <[email protected]>
date: Tue Feb 26 08:41:06 EST 2019

Rewrite relative action URLS

Fixes #5701

--- a/transform/urlreplacers/absurlreplacer.go
+++ b/transform/urlreplacers/absurlreplacer.go
@@ -49,6 +49,7 @@
 	return []*prefix{
 		{b: []byte("src="), f: checkCandidateBase},
 		{b: []byte("href="), f: checkCandidateBase},
+		{b: []byte("action="), f: checkCandidateBase},
 		{b: []byte("srcset="), f: checkCandidateSrcset},
 	}
 }
--- a/transform/urlreplacers/absurlreplacer_test.go
+++ b/transform/urlreplacers/absurlreplacer_test.go
@@ -89,8 +89,8 @@
 schemaless2: &lt;img srcset=&quot;//img.jpg&quot; src=&quot;//basic.jpg2&gt; POST
 `
 
-	relPathVariations        = `PRE. a href="/img/small.jpg" POST.`
-	relPathVariationsCorrect = `PRE. a href="../../img/small.jpg" POST.`
+	relPathVariations        = `PRE. a href="/img/small.jpg" input action="/foo.html" POST.`
+	relPathVariationsCorrect = `PRE. a href="../../img/small.jpg" input action="../../foo.html" POST.`
 
 	testBaseURL = "http://base/"
 )