squeeze

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

commit 2edbb825831832d2ce7c70d7526c049b88582c61
parent 0993e1b2dee5862d802339116542f9ca0815e23f
Author: St John Karp <stjohn@mulligrubs.me>
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"