@@ -15,6 +15,7 @@ package blockquotes_test
1515
1616import (
1717 "path/filepath"
18+ "strings"
1819 "testing"
1920
2021 "github.com/gohugoio/hugo/hugolib"
@@ -76,7 +77,7 @@ title: "p1"
7677 "Blockquote Alert: |<p>This is a note with some whitespace after the alert type.</p>|alert|" ,
7778 "Blockquote Alert: |<p>This is a tip.</p>" ,
7879 "Blockquote Alert: |<p>This is a caution with some whitespace before the alert type.</p>|alert|" ,
79- "Blockquote: |<p>A regular blockquote.</p>|regular|" ,
80+ "Blockquote: |<p>A regular blockquote.</p>\n |regular|" ,
8081 "Blockquote Alert Attributes: |<p>This is a tip with attributes.</p>|map[class:foo bar id:baz]|" ,
8182 filepath .FromSlash ("/content/p1.md:19:3" ),
8283 "Blockquote Alert Page: |<p>This is a tip with attributes.</p>|p1|p1|" ,
@@ -248,6 +249,37 @@ title: home
248249 "AlertType: fourteen|AlertTitle: title|Text: <p><img src=\" a.jpg\" alt=\" alt\" ></p>|" ,
249250 "AlertType: fifteen|AlertTitle: <em>title</em>|Text: |" ,
250251 "AlertType: sixteen|AlertTitle: <em>title</em>|Text: <p>line one</p>|" ,
251- "AlertType: |AlertTitle: |Text: <p>seventeen</p>|" ,
252+ "AlertType: |AlertTitle: |Text: <p>seventeen</p>\n |" ,
252253 )
253254}
255+
256+ // Issue14046
257+ func TestBlockquoteDefaultOutput (t * testing.T ) {
258+ t .Parallel ()
259+
260+ files := `
261+ -- hugo.toml --
262+ disableKinds = ['home','rss','section','sitemap','taxonomy','term']
263+ -- content/p1.md --
264+ ---
265+ title: p1
266+ ---
267+ > foo
268+ -- layouts/page.html --
269+ |{{ .Content }}|
270+ -- xxx --
271+ <blockquote>
272+ {{ .Text }}
273+ </blockquote>
274+ `
275+
276+ want := "|<blockquote>\n <p>foo</p>\n </blockquote>\n |"
277+
278+ b := hugolib .Test (t , files )
279+ b .AssertFileContent ("public/p1/index.html" , want ) // fail
280+
281+ files = strings .ReplaceAll (files , "xxx" , "layouts/_markup/render-blockquote.html" )
282+
283+ b = hugolib .Test (t , files )
284+ b .AssertFileContent ("public/p1/index.html" , want )
285+ }
0 commit comments