diff options
Diffstat (limited to 'internal/router/template_test.go')
| -rw-r--r-- | internal/router/template_test.go | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/internal/router/template_test.go b/internal/router/template_test.go index 19bf759e0..1c82d3ba4 100644 --- a/internal/router/template_test.go +++ b/internal/router/template_test.go @@ -22,10 +22,19 @@ import ( "testing" ) -func TestOutdentPre(t *testing.T) { +func TestOutdentPreformatted(t *testing.T) { const html = template.HTML(` <div class="text"> - <div class="content" lang="en"> + <div + class="content" + lang="en" + title="DW from Arthur is labeled "crawlers". + + She's reading a sign on a door that says: "robots.txt: don't crawl this website, it's not for you, please, thanks." + + With her hands on her hips looking annoyed she says "That sign won't stop me because I can't read!"" + alt="pee pee poo poo" + > <p>Here's a bunch of HTML, read it and weep, weep then!</p> <pre><code class="language-html"><section class="about-user"> <div class="col-header"> @@ -67,7 +76,15 @@ func TestOutdentPre(t *testing.T) { </div> </div> <div class="text"> - <div class="content" lang="en"> + <div + class="content" + lang="en" + alt="DW from Arthur is labeled "crawlers". + + She's reading a sign on a door that says: "robots.txt: don't crawl this website, it's not for you, please, thanks." + + With her hands on her hips looking annoyed she says "That sign won't stop me because I can't read!"" + > <p>Here's a bunch of HTML, read it and weep, weep then!</p> <pre><code class="language-html"><section class="about-user"> <div class="col-header"> @@ -112,7 +129,16 @@ func TestOutdentPre(t *testing.T) { const expected = template.HTML(` <div class="text"> - <div class="content" lang="en"> + <div + class="content" + lang="en" + title="DW from Arthur is labeled "crawlers". + + She's reading a sign on a door that says: "robots.txt: don't crawl this website, it's not for you, please, thanks." + +With her hands on her hips looking annoyed she says "That sign won't stop me because I can't read!"" + alt="pee pee poo poo" + > <p>Here's a bunch of HTML, read it and weep, weep then!</p> <pre><code class="language-html"><section class="about-user"> <div class="col-header"> @@ -154,7 +180,15 @@ func TestOutdentPre(t *testing.T) { </div> </div> <div class="text"> - <div class="content" lang="en"> + <div + class="content" + lang="en" + alt="DW from Arthur is labeled "crawlers". + +She's reading a sign on a door that says: "robots.txt: don't crawl this website, it's not for you, please, thanks." + +With her hands on her hips looking annoyed she says "That sign won't stop me because I can't read!"" + > <p>Here's a bunch of HTML, read it and weep, weep then!</p> <pre><code class="language-html"><section class="about-user"> <div class="col-header"> @@ -197,7 +231,7 @@ func TestOutdentPre(t *testing.T) { </div> `) - out := outdentPre(html) + out := outdentPreformatted(html) if out != expected { t.Fatalf("unexpected output:\n`%s`\n", out) } |
