squeeze

A static site generator that can put the toothpaste back in the tube.
git clone https://git.stjo.hn/squeeze
Log | Files | Refs | README | LICENSE

commit 9c72dbdc6e4d2f281cf543afab85b5cf0a7b70d2
parent d2324f6d835411f367bcb4104037437940bd9f12
Author: St John Karp <contact@stjo.hn>
Date:   Mon, 19 Oct 2020 15:11:13 -0500

Fix some block-level elements

Some Markdown generators don't recognize newer block-level elements
and try to wrap them in <p> tags. Some sed commands will undo that.

Diffstat:
Mgenerate_html.sh | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/generate_html.sh b/generate_html.sh @@ -3,5 +3,12 @@ echo "$1" swipl --traditional --quiet -l parse_entry.pl -g "consult('$2/site.pl'), generate_entry('$2/source/$1')." | + # Unwrap block-level elements that have erroneously been wrapped in <p> tags. + sed "s|<p><details|<details|g" | + sed "s|</summary></p>|</summary>|g" | + sed "s|<p></details></p>|</details>|g" | + sed "s|<p><figure|<figure|g" | + sed "s|</figure></p>|</figure>|g" | + # Smarten punctuation. smartypants \ > "$2/output/${1%%.md}.html"