summaryrefslogtreecommitdiffstats
path: root/hugolib/page_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-05-28 11:01:47 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-05-29 11:50:58 +0200
commit0f8dc47037f59156c04540d97ed1b588e6bc1164 (patch)
tree78d76bb4d52b2f35b609013fde6ec4f5e19730c8 /hugolib/page_test.go
parent3b478f50b7408ad78d085fa6dbc3c7a683c9d943 (diff)
Remove Blackfriday markdown engine
It has been deprecated for a long time, its v1 version is not maintained anymore, and there are many known issues. Goldmark should be a mature replacement by now. Closes #9934
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r--hugolib/page_test.go104
1 files changed, 3 insertions, 101 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index e5f8840a6..1d9e3e348 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -240,16 +240,6 @@ the cylinder and strike me down. ## BB
"You're a great Granser," he cried delightedly, "always making believe them little marks mean something."
`
- simplePageWithAdditionalExtension = `+++
-[blackfriday]
- extensions = ["hardLineBreak"]
-+++
-first line.
-second line.
-
-fourth line.
-`
-
simplePageWithURL = `---
title: Simple
url: simple/url/
@@ -694,26 +684,6 @@ func TestPageWithShortCodeInSummary(t *testing.T) {
testAllMarkdownEnginesForPages(t, assertFunc, nil, simplePageWithShortcodeInSummary)
}
-func TestPageWithAdditionalExtension(t *testing.T) {
- t.Parallel()
- cfg, fs := newTestCfg()
- cfg.Set("markup", map[string]any{
- "defaultMarkdownHandler": "blackfriday", // TODO(bep)
- })
-
- c := qt.New(t)
-
- writeSource(t, fs, filepath.Join("content", "simple.md"), simplePageWithAdditionalExtension)
-
- s := buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{SkipRender: true})
-
- c.Assert(len(s.RegularPages()), qt.Equals, 1)
-
- p := s.RegularPages()[0]
-
- checkPageContent(t, p, "<p>first line.<br />\nsecond line.</p>\n\n<p>fourth line.</p>\n")
-}
-
func TestTableOfContents(t *testing.T) {
cfg, fs := newTestCfg()
c := qt.New(t)
@@ -1373,7 +1343,7 @@ title: "HTML Content"
---
`
b.WithContent("regular.html", frontmatter+`<h1>Hugo</h1>`)
- b.WithContent("noblackfridayforyou.html", frontmatter+`**Hugo!**`)
+ b.WithContent("nomarkdownforyou.html", frontmatter+`**Hugo!**`)
b.WithContent("manualsummary.html", frontmatter+`
<p>This is summary</p>
<!--more-->
@@ -1387,8 +1357,8 @@ title: "HTML Content"
"Summary: Hugo|Truncated: false")
b.AssertFileContent(
- "public/noblackfridayforyou/index.html",
- "Permalink: http://example.com/noblackfridayforyou/|**Hugo!**|",
+ "public/nomarkdownforyou/index.html",
+ "Permalink: http://example.com/nomarkdownforyou/|**Hugo!**|",
)
// https://github.com/gohugoio/hugo/issues/5723
@@ -2011,74 +1981,6 @@ Link with URL as text
`)
}
-func TestBlackfridayDefault(t *testing.T) {
- t.Parallel()
-
- b := newTestSitesBuilder(t).WithConfigFile("toml", `
-baseURL = "https://example.org"
-
-[markup]
-defaultMarkdownHandler="blackfriday"
-[markup.highlight]
-noClasses=false
-[markup.goldmark]
-[markup.goldmark.renderer]
-unsafe=true
-
-
-`)
- // Use the new attribute syntax to make sure it's not Goldmark.
- b.WithTemplatesAdded("_default/single.html", `
-Title: {{ .Title }}
-Content: {{ .Content }}
-
-`, "shortcodes/s.html", `## Code
-{{ .Inner }}
-`)
-
- content := `
-+++
-title = "A Page!"
-+++
-
-
-## Code Fense in Shortcode
-
-{{% s %}}
-S:
-{{% s %}}
-$$$bash {hl_lines=[1]}
-SHORT
-$$$
-{{% /s %}}
-{{% /s %}}
-
-## Code Fence
-
-$$$bash {hl_lines=[1]}
-MARKDOWN
-$$$
-
-`
- content = strings.ReplaceAll(content, "$$$", "```")
-
- for i, ext := range []string{"md", "html"} {
- b.WithContent(fmt.Sprintf("page%d.%s", i+1, ext), content)
- }
-
- b.Build(BuildCfg{})
-
- // Blackfriday does not support this extended attribute syntax.
- b.AssertFileContent("public/page1/index.html",
- `<pre tabindex="0"><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">SHORT</code></pre>`,
- `<pre tabindex="0"><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">MARKDOWN`,
- )
-
- b.AssertFileContent("public/page2/index.html",
- `<pre tabindex="0"><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">SHORT`,
- )
-}
-
func TestPageCaseIssues(t *testing.T) {
t.Parallel()