paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 35db91a7bfbf5bef0ec30cb559671dda3353c49a
parent becab18993872b85e0a21bce2ad5956ccfb95ff6
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Fri, 22 May 2020 22:53:06 -0400

Add strict mode flag to compile script

Strict mode is needed to emulate the behaviour of strict markdown (the
same as using the `markdown` command). This allows inlining certain HTML
tags in the markdown which pandoc normally would interpret as markdown
content instead of HTML content.

This flag should be used when compiling pages that contain HTML tags
like <div> in the markdown to prevent them from being transformed into
code blocks.

Diffstat:
Mcompile | 17++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/compile b/compile @@ -56,6 +56,13 @@ mkdir -p "$cssDir" buildDir="build/" mkdir -p "$buildDir" +if [ "$1" = "-s" ]; then + strictMode="true" + shift +else + strictMode="false" +fi + # Prints the message passed as the 1st argument in red. print_error_msg() { @@ -122,9 +129,13 @@ compile_md() mkdir -p "$buildDir"/"$subDir" mkdir -p "$htmlDir"/"$subDir" - pandoc -o "$buildDir"/"$subDir"/"$fileName"-content.html \ - --highlight-style zenburn \ - -f markdown -t html $file 2>/dev/null + if [ "$strictMode" = "true" ]; then + pandoc -o "$buildDir"/"$subDir"/"$fileName"-content.html \ + -f markdown_strict -t html $file 2>/dev/null + else + pandoc -o "$buildDir"/"$subDir"/"$fileName"-content.html \ + -f markdown -t html $file 2>/dev/null + fi cat "$buildDir"/header.html \ "$buildDir"/"$subDir"/"$fileName"-content.html \