Skip to content

Commit

Permalink
Strip #
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvelle committed Nov 23, 2024
1 parent 61231a4 commit 8cc7ee7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/no/ndla/taxonomy/util/PrettyUrlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private static String cleanString(String name) {
return Jsoup.parse(name)
.text()
.toLowerCase()
.replaceAll("[.,!?()/«»'¡:`’]", "")
.replaceAll("[.,!?()/«»'¡:`’#]", "")
.replaceAll("æ", "a")
.replaceAll("ø", "o")
.replaceAll("ö", "o")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/no/ndla/taxonomy/util/PrettyUrlUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void test_create_pretty_url_with_punctuation() {
.get());
assertEquals(
"/r/this-is-a-title-and-a-12/hash",
PrettyUrlUtil.createPrettyUrl(Optional.empty(), "This is a title and a 1/2", "hash", NodeType.RESOURCE)
PrettyUrlUtil.createPrettyUrl(Optional.empty(), "This is a #title and a 1/2", "hash", NodeType.RESOURCE)
.get());
assertEquals(
"/r/this-is-a-title---with-long-dash/hash",
Expand Down

0 comments on commit 8cc7ee7

Please sign in to comment.