mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Fix auto generated header ids so they don't contain e.g. hyperlink destinations (note)
This makes the header ids match the newly added dt ids. Also make sure newlines are preserved in hooks' `.PlainText`. Fixes #13405 Fixes #13410
This commit is contained in:
@@ -350,3 +350,31 @@ Image: 
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Issue 13410.
|
||||
func TestRenderHooksMultilineTitlePlainText(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
-- content/p1.md --
|
||||
---
|
||||
title: "p1"
|
||||
---
|
||||
|
||||
First line.
|
||||
Second line.
|
||||
----------------
|
||||
-- layouts/_default/_markup/render-heading.html --
|
||||
Plain text: {{ .PlainText }}|Text: {{ .Text }}|
|
||||
-- layouts/_default/single.html --
|
||||
Content: {{ .Content}}|
|
||||
}
|
||||
`
|
||||
b := Test(t, files)
|
||||
|
||||
b.AssertFileContent("public/p1/index.html",
|
||||
"Content: Plain text: First line.\nSecond line.|",
|
||||
"|Text: First line.\nSecond line.||\n",
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user