Merge pull request #9 from dylan-lom/#5-header-wrapped-in-p-tag

(#5) Extra to remove <p> tags around <head>
This commit is contained in:
Dylan Lom 2021-02-06 18:13:30 +11:00 committed by GitHub
commit 1fbd578186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 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>"

2
extras/shmd-tidy-head.sh Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env sh
sed 's/<p><head>/<head>/' | sed 's/<\/head><\/p>/<\/head>/'