add unit-tests for export

This commit is contained in:
rcmerci
2023-03-14 17:25:49 +08:00
committed by Tienson Qin
parent 6fae1a8c09
commit 3cda885b9b
2 changed files with 111 additions and 26 deletions

View File

@@ -449,11 +449,11 @@
(let [ast (gp-mldoc/->edn content (gp-mldoc/default-config format))
ast (mapv common/remove-block-ast-pos ast)
ast (removev common/Properties-block-ast? ast)
keep-level<=n (get-in *state* [:export-options :keep-only-level<=N])
ast (if (pos? keep-level<=n)
(common/keep-only-level<=n ast keep-level<=n)
ast)
ast* (common/replace-block&page-reference&embed ast)
keep-level<=n (get-in *state* [:export-options :keep-only-level<=N])
ast* (if (pos? keep-level<=n)
(common/keep-only-level<=n ast* keep-level<=n)
ast*)
ast** (if (= "no-indent" (get-in *state* [:export-options :indent-style]))
(mapv common/replace-Heading-with-Paragraph ast*)
ast*)