diff options
author | Berin Larson <[email protected]> | 2019-02-26 13:41:06 +0530 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-02-26 11:31:34 +0100 |
commit | c154c2f7b2a6703dbde7f6bd2a1817a39c6fd2ea (patch) | |
tree | fc569aaecc9e62461f9df168f7ed3a1ae7920f47 /transform | |
parent | 075b17ee1d621e0ebbcecf1063f8f68a00ac221a (diff) | |
download | hugo-c154c2f7b2a6703dbde7f6bd2a1817a39c6fd2ea.tar.gz hugo-c154c2f7b2a6703dbde7f6bd2a1817a39c6fd2ea.zip |
Rewrite relative action URLS
Fixes #5701
Diffstat (limited to 'transform')
-rw-r--r-- | transform/urlreplacers/absurlreplacer.go | 1 | ||||
-rw-r--r-- | transform/urlreplacers/absurlreplacer_test.go | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/transform/urlreplacers/absurlreplacer.go b/transform/urlreplacers/absurlreplacer.go index 27f32b200..02083d9f5 100644 --- a/transform/urlreplacers/absurlreplacer.go +++ b/transform/urlreplacers/absurlreplacer.go @@ -49,6 +49,7 @@ func newPrefixState() []*prefix { return []*prefix{ {b: []byte("src="), f: checkCandidateBase}, {b: []byte("href="), f: checkCandidateBase}, + {b: []byte("action="), f: checkCandidateBase}, {b: []byte("srcset="), f: checkCandidateSrcset}, } } diff --git a/transform/urlreplacers/absurlreplacer_test.go b/transform/urlreplacers/absurlreplacer_test.go index be6b91929..e7c90adc9 100644 --- a/transform/urlreplacers/absurlreplacer_test.go +++ b/transform/urlreplacers/absurlreplacer_test.go @@ -89,8 +89,8 @@ schemaless: <img srcset='//img.jpg' src='//basic.jpg'> schemaless2: <img srcset="//img.jpg" src="//basic.jpg2> 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/" ) |