diff options
author | EuAndreh <eu@euandre.org> | 2025-04-15 08:22:29 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-04-15 08:22:29 -0300 |
commit | ba74f8bde87dada9ecb046a122529c551ddc3322 (patch) | |
tree | 5c8f152ec31bc510554394f7c9c3442bfd9d21ec | |
parent | src/adoc: Rewrite as a pipeline with cat(1) at the start (diff) | |
download | adoc-ba74f8bde87dada9ecb046a122529c551ddc3322.tar.gz adoc-ba74f8bde87dada9ecb046a122529c551ddc3322.tar.xz |
src/adoc: Add `fix_header_anchor_position()` stage
-rwxr-xr-x | src/adoc | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -46,6 +46,10 @@ plaintext_links() { }' } +fix_header_anchor_position() { + sed 's|^\(<h2 .*\)\(<a .*</a>\)\(.*\)\(</h2>\)$|\1\3\2\4|' +} + runtidy() { statusconv 1:0 tidy \ -quiet \ @@ -65,6 +69,7 @@ indent_4_blocks() { } cat "$FILENAME" | - plaintext_links | - asciidoctor -s - | + plaintext_links | + asciidoctor -s - | + fix_header_anchor_position | indent_4_blocks |