ocaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Consistent treating of unicode in URLs

I do not percent-encode URLs, because browsers are increasingly
supporting unicode.

One subtle point is that the redirect index.html dummy files need to
have <meta charset="utf-8"> for this to work properly.

References: https://todo.sr.ht/~jonsterling/forester/186

+8 -7
+2 -2
lib/compiler/Xml_forester.ml
··· 60 60 let display_uri attrs = f_text_tag "display-uri" attrs 61 61 let route attrs = f_text_tag "route" attrs 62 62 let source_path attrs = f_text_tag "source-path" attrs 63 - let href fmt = uri_attr "href" fmt 63 + let href fmt = string_attr "href" fmt 64 64 let date = f_std_tag "date" 65 65 let last_changed = f_std_tag "last-changed" 66 66 let year attrs = f_text_tag "year" attrs ··· 92 92 let number_ fmt = string_attr "number" fmt 93 93 94 94 let img = html_void_tag "img" 95 - let src fmt = uri_attr "src" fmt 95 + let src fmt = string_attr "src" fmt 96 96 97 97 let resource = f_std_tag "resource" 98 98 let resource_content = f_std_tag "resource-content"
+3 -3
lib/core/URI.ml
··· 63 63 Uri.canonicalize @@ 64 64 Uri.with_path (hydrate uri) @@ String.concat "/" xs 65 65 66 - let t = Repr.map Repr.string (Fun.compose dehydrate Uri.of_string) (Fun.compose Uri.to_string hydrate) 67 - 68 66 let pp (fmt : Format.formatter) (uri : t) = 69 67 Format.fprintf fmt "%s" @@ 70 - Uri.to_string @@ hydrate uri (* wanted it not pct-encoded, but we'll see*) 68 + Uri.pct_decode @@ Uri.to_string @@ hydrate uri 71 69 72 70 let to_string x = 73 71 Uri.pct_decode @@ Uri.to_string @@ hydrate x 72 + 73 + let t = Repr.map Repr.string (Fun.compose dehydrate Uri.of_string) to_string 74 74 75 75 let of_string_exn str = 76 76 dehydrate @@ Uri.canonicalize @@ Uri.of_string str
+2 -1
lib/frontend/Forester.ml
··· 106 106 [ 107 107 http_equiv `refresh; 108 108 content "0;url=%s" uri_string 109 - ] 109 + ]; 110 + meta [ charset "utf-8" ] 110 111 ] 111 112 ] 112 113
+1 -1
lib/frontend/Legacy_xml_client.ml
··· 266 266 ] 267 267 | Some article -> 268 268 [ 269 - X.optional_ (X.href "%s") @@ Option.map (Fun.compose URI.to_string @@ route forest) article.frontmatter.uri; 269 + X.href "%s" @@ URI.to_string @@ route forest link.href; 270 270 X.title_ "%s" @@ 271 271 Plain_text_client.string_of_content ~forest: forest ~router: (route forest) @@ 272 272 State.get_expanded_title ?scope: (Scope.read ()) article.frontmatter forest;