File tree 2 files changed +18
-0
lines changed
lib/tableau/extensions/post_extension/posts
test/tableau/extensions/post_extension/posts
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -62,5 +62,6 @@ defmodule Tableau.PostExtension.Posts.Post do
62
62
|> String . replace ( "_" , "-" )
63
63
|> String . replace ( ~r/ [^[:alnum:]\/ \- .]/ , "" )
64
64
|> String . downcase ( )
65
+ |> URI . encode ( )
65
66
end
66
67
end
Original file line number Diff line number Diff line change @@ -21,6 +21,23 @@ defmodule Tableau.PostExtension.Posts.PostTest do
21
21
assert % { permalink: "/blog/articles/foo-man-chu" } = actual
22
22
end
23
23
24
+ test "handles fancy characters in permalink" do
25
+ actual =
26
+ Post . build (
27
+ "some/file/name.md" ,
28
+ % {
29
+ title: "¿Qué es la programación funcional?" ,
30
+ type: "articles" ,
31
+ permalink: "/blog/:type/:title" ,
32
+ layout: Some.Layout ,
33
+ date: "2023-10-13"
34
+ } ,
35
+ "hi"
36
+ )
37
+
38
+ assert % { permalink: "/blog/articles/%C2qu%C3-es-la-programaci%C3n-funcional" } = actual
39
+ end
40
+
24
41
test "substitutes date pieces into permalink" do
25
42
actual =
26
43
Post . build (
You can’t perform that action at this time.
0 commit comments