From a50fa0aceba21830a935e8b7b7cd75fd0cafd767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Tue, 14 Nov 2023 12:55:53 +0100 Subject: [PATCH] Switch to non-strict commonmark --- reynir-www.opam | 6 ++++-- src/dune | 2 +- src/task.ml | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/reynir-www.opam b/reynir-www.opam index 541502a..3a8c4da 100644 --- a/reynir-www.opam +++ b/reynir-www.opam @@ -26,16 +26,18 @@ depends: [ "yocaml" "yocaml_unix" "yocaml_yaml" - "yocaml_markdown" + #"yocaml_markdown" "yocaml_git" "yocaml_jingoo" + "yocaml_cmark" ] pin-depends: [ ["yocaml.dev" "git+https://github.com/xhtmlboi/yocaml.git"] ["yocaml_unix.dev" "git+https://github.com/xhtmlboi/yocaml.git"] ["yocaml_yaml.dev" "git+https://github.com/xhtmlboi/yocaml.git"] - ["yocaml_markdown.dev" "git+https://github.com/xhtmlboi/yocaml.git"] + #["yocaml_markdown.dev" "git+https://github.com/xhtmlboi/yocaml.git"] ["yocaml_jingoo.dev" "git+https://github.com/xhtmlboi/yocaml.git"] ["yocaml_git.dev" "git+https://github.com/xhtmlboi/yocaml.git"] + ["yocaml_cmark.dev" "git+https://github.com/xhtmlboi/yocaml.git"] ] diff --git a/src/dune b/src/dune index 950c76f..2340baa 100644 --- a/src/dune +++ b/src/dune @@ -14,7 +14,7 @@ git-unix yocaml yocaml_yaml - yocaml_markdown + yocaml_cmark yocaml_unix yocaml_git yocaml_jingoo)) diff --git a/src/task.ml b/src/task.ml index 5952f1f..e1f9fc0 100644 --- a/src/task.ml +++ b/src/task.ml @@ -1,6 +1,6 @@ open Yocaml module Metaformat = Yocaml_yaml -module Markup = Yocaml_markdown +module Markup = Yocaml_cmark module Template = Yocaml_jingoo let css_target target = "css" |> into target @@ -53,7 +53,7 @@ let with_layout (type a) (module M : Metadata.INJECTABLE with type t = a) >>^ (fun (({ Model.Page.title; head_extra }, content), v) -> M.merge ~title ~head_extra v, content) >>^ apply_template_from_string - >>> Markup.content_to_html () + >>> Markup.content_to_html ~strict:false () >>> Template.apply_as_template (module M) "templates/layout.html" >>^ Stdlib.snd) @@ -62,7 +62,7 @@ let process_articles target = process_files [ "posts" ] File.is_markdown (fun article_file -> create_file (article_target article_file target) (Metaformat.read_file_with_metadata (module Model.Article) article_file - >>> Markup.content_to_html () + >>> Markup.content_to_html ~strict:false () >>> Template.apply_as_template (module Model.Article) "templates/article.html" >>> Template.apply_as_template (module Model.Article) "templates/layout.html" >>^ Stdlib.snd)) @@ -87,7 +87,7 @@ let page page_file target = create_file target (watch Sys.argv.(0) >>> Metaformat.read_file_with_metadata (module Model.Page) page_file - >>> Markup.content_to_html () + >>> Markup.content_to_html ~strict:false () >>> Template.apply_as_template (module Model.Page) "templates/layout.html" >>^ Stdlib.snd)