mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 23:20:49 +03:00
parent
78c99463fd
commit
baa62d0abb
1 changed files with 15 additions and 1 deletions
|
@ -250,7 +250,7 @@ And then:
|
||||||
This is **plain** text.
|
This is **plain** text.
|
||||||
|
|
||||||
{{< /inside >}}
|
{{< /inside >}}
|
||||||
`, "<div><h1 id=\"more-here\">More Here</h1>\n\n<p><a href=\"http://spf13.com\">link</a> and text</p>\n</div>\n\n<p>And then:</p>\n\n<p><div>\n# More Here\n\nThis is **plain** text.\n\n</div>", wt)
|
`, "<div><h1 id=\"more-here\">More Here</h1>\n\n<p><a href=\"http://spf13.com\">link</a> and text</p>\n</div>\n\n<p>And then:</p>\n\n<div>\n# More Here\n\nThis is **plain** text.\n\n</div>", wt)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEmbeddedSC(t *testing.T) {
|
func TestEmbeddedSC(t *testing.T) {
|
||||||
|
@ -335,6 +335,20 @@ func TestFigureLinkWithTargetAndRel(t *testing.T) {
|
||||||
CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" target="_blank" rel="noopener" >}}`, "\n<figure>\n <a href=\"/jump/here/on/clicking\" target=\"_blank\" rel=\"noopener\">\n <img src=\"/found/here\" />\n </a>\n \n</figure>\n", nil)
|
CheckShortCodeMatch(t, `{{< figure src="/found/here" link="/jump/here/on/clicking" target="_blank" rel="noopener" >}}`, "\n<figure>\n <a href=\"/jump/here/on/clicking\" target=\"_blank\" rel=\"noopener\">\n <img src=\"/found/here\" />\n </a>\n \n</figure>\n", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #1642
|
||||||
|
func TestShortcodeWrappedInPIssue(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
wt := func(tem tpl.TemplateHandler) error {
|
||||||
|
tem.AddTemplate("_internal/shortcodes/bug.html", `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
CheckShortCodeMatch(t, `
|
||||||
|
{{< bug >}}
|
||||||
|
|
||||||
|
{{< bug >}}
|
||||||
|
`, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", wt)
|
||||||
|
}
|
||||||
|
|
||||||
const testScPlaceholderRegexp = "HAHAHUGOSHORTCODE-\\d+HBHB"
|
const testScPlaceholderRegexp = "HAHAHUGOSHORTCODE-\\d+HBHB"
|
||||||
|
|
||||||
func TestExtractShortcodes(t *testing.T) {
|
func TestExtractShortcodes(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue