target := make([]rune, 0, len(source))
for _, r := range source {
- if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '.' || r == '/' || r == '_' || r == '-' {
+ if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '.' || r == '/' || r == '_' || r == '-' || r == '#' {
target = append(target, r)
}
}
name = "Tax RSS"
url = "/two/key.xml"
identifier="xml"
+[[menu.hash]]
+ name = "Tax With #"
+ url = "/resource#anchor"
+ identifier="hash"
[[menu.unicode]]
name = "Unicode Russian"
identifier = "unicode-russian"
}
+// issue #888
+func TestMenuWithHashInUrl(t *testing.T) {
+ ts := setupMenuTests(t, MENU_PAGE_SOURCES)
+ defer resetMenuTestState(ts)
+
+ me := ts.findTestMenuEntryById("hash", "hash")
+
+ assert.NotNil(t, me)
+
+ assert.Equal(t, "/Zoo/resource/#anchor", me.Url)
+}
+
// issue #719
func TestMenuWithUnicodeUrls(t *testing.T) {
for _, uglyUrls := range []bool{true, false} {