unescape xml
This commit is contained in:
@@ -49,6 +49,16 @@ module Render = struct
|
|||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>|eos}
|
</html>|eos}
|
||||||
|
|
||||||
|
let replace_sequence r t s =
|
||||||
|
Str.(global_replace (regexp r) t s)
|
||||||
|
|
||||||
|
let html_unescape s =
|
||||||
|
s
|
||||||
|
|> replace_sequence "‘" "'"
|
||||||
|
|> replace_sequence "’" "'"
|
||||||
|
|> replace_sequence ">" ">"
|
||||||
|
|> replace_sequence "<" "<"
|
||||||
|
|
||||||
let not_found_template =
|
let not_found_template =
|
||||||
Printf.sprintf "%s %s %s"
|
Printf.sprintf "%s %s %s"
|
||||||
@@ -64,11 +74,7 @@ module Render = struct
|
|||||||
|
|
||||||
let render_page content =
|
let render_page content =
|
||||||
Printf.sprintf
|
Printf.sprintf
|
||||||
{eos|
|
"%s %s %s"
|
||||||
%s
|
|
||||||
%s
|
|
||||||
%s
|
|
||||||
|eos}
|
|
||||||
header_template
|
header_template
|
||||||
content
|
content
|
||||||
footer_template
|
footer_template
|
||||||
@@ -88,7 +94,9 @@ module Render = struct
|
|||||||
<link>https://rawley.xyz/blog/%s</link>
|
<link>https://rawley.xyz/blog/%s</link>
|
||||||
<description></description>
|
<description></description>
|
||||||
</item>|eos}
|
</item>|eos}
|
||||||
p.title p.slug
|
(html_unescape p.title) p.slug
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
let handle_error e =
|
let handle_error e =
|
||||||
print_endline (Caqti_error.show e);
|
print_endline (Caqti_error.show e);
|
||||||
|
|||||||
Reference in New Issue
Block a user