Skip to content

Commit 671c8d6

Browse files
authored
Merge pull request #507 from Balastrong/bugfix/497-tag-url
Replace space with - in tags url
2 parents fd13ca1 + 6e75ab9 commit 671c8d6

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

test/e2e/test_edge-cases.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from playwright.sync_api import Page, expect
2+
3+
"""
4+
Checking for broken tag links with spaces in them
5+
"""
6+
def test_tag_broken_link_spaces(page: Page):
7+
page.goto("/show/linux-unplugged/489/")
8+
page.locator(".tag > a", has_text="linux unplugged").click()
9+
expect(page.locator(".title", has_text="Tag: linux unplugged")).to_be_visible()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ range $tag := . }}
22
<span class="tag">
33
<!-- urlquery found here: https://discourse.gohugo.io/t/url-encoding-percent-encoding-with-hugo/16546/13 -->
4-
<a href="{{ `/tags/` }}{{ urlquery $tag }}/">{{$tag}}</a>
4+
<a href="{{ `/tags/` }}{{ replace $tag " " "-" | urlquery }}/">{{$tag}}</a>
55
</span>
66
{{ end }}

0 commit comments

Comments
 (0)