summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-03-23 09:20:43 -0300
committerEuAndreh <eu@euandre.org>2025-03-23 09:20:43 -0300
commit3705198654599232dad7ec73dbf0fe2fd4ca5cc1 (patch)
treec9c765bde60ec02c6af2907197c691c6e12b43a4
parentsrc/conf: Do not error on missing title (diff)
downloadmkwb-3705198654599232dad7ec73dbf0fe2fd4ca5cc1.tar.gz
mkwb-3705198654599232dad7ec73dbf0fe2fd4ca5cc1.tar.xz
src/htmlbody: Use tidy(1) to indent htmlbody snippets by 4 blocks
-rwxr-xr-xsrc/htmlbody9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/htmlbody b/src/htmlbody
index e4e5692..1e31751 100755
--- a/src/htmlbody
+++ b/src/htmlbody
@@ -23,4 +23,11 @@ plaintext_links() {
}' "$1"
}
-plaintext_links "$FILENAME" | asciidoctor -s -
+indent_4_blocks() {
+ printf '<div><div><div><div>%s</div></div></div></div>' "$(cat -)" |
+ tidy -quiet -indent -xml |
+ head -n -4 |
+ tail -n +5
+}
+
+plaintext_links "$FILENAME" | asciidoctor -s - | indent_4_blocks