(#5) Add shmd-good-html script

This commit is contained in:
Dylan Lom 2021-02-06 18:11:57 +11:00
parent cdcc977f59
commit 0e827d0fad
1 changed files with 10 additions and 0 deletions

10
extras/shmd-good-html.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
md="$(cat)"
if (echo "$md" | grep -q '</head>'); then
md="$(echo "$md" | sed 's/<\/head>/<\/head>\n<body>/')"
else
md="$(echo "<body>\n$md")"
fi
echo "<!DOCTYPE html>\n<html>\n$md\n</body>\n</html>"