convert leading TAB chars into 8 spaces before running pandoc
The `bin/pandoc-wrapper.sh` tool will use `expand(1)` to expand leading ASCII TAB characters into multiples of 8 ASCII space characters on all markdown data before piping it into `pandoc(1)`. Thus, any leading ASCII TAB character in markdown files will be automatically converted into spaces using 8 character tabs. Changed `bin/pandoc-wrapper.sh` VERSION from "1.6.3 2024-06-22" to "1.7 2024-06-22" to preform the above. Perform `make www` to perform the above and test under macOS. It turns out that only one other HTML file was impacted: `bugs.html`. All other leading ASCII tab characters have been rendered [Mostly Harmless](https://en.wikipedia.org/wiki/Mostly_Harmless). :)
This commit is contained in:
1 parent
2626143532
commit
e66631b543
2 files changed
+16
-9
No files matched your search
+15
-8
@@ -99,11 +99,17 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
|
|||||||
|
|
||||||
# set variables referenced in the usage message
|
# set variables referenced in the usage message
|
||||||
#
|
#
|
||||||
export VERSION="1.6.3 2024-06-22"
|
export VERSION="1.7 2024-06-22"
|
||||||
NAME=$(basename "$0")
|
NAME=$(basename "$0")
|
||||||
export NAME
|
export NAME
|
||||||
export V_FLAG=0
|
export V_FLAG=0
|
||||||
export PANDOC_TOOL
|
export PANDOC_TOOL
|
||||||
|
EXPAND_TOOL=$(type -P expand)
|
||||||
|
export EXPAND_TOOL
|
||||||
|
if [[ -z "$EXPAND_TOOL" ]]; then
|
||||||
|
echo "$0: FATAL: expand tool is not installed or not in \$PATH" 1>&2
|
||||||
|
exit 5
|
||||||
|
fi
|
||||||
GIT_TOOL=$(type -P git)
|
GIT_TOOL=$(type -P git)
|
||||||
export GIT_TOOL
|
export GIT_TOOL
|
||||||
if [[ -z "$GIT_TOOL" ]]; then
|
if [[ -z "$GIT_TOOL" ]]; then
|
||||||
@@ -351,8 +357,9 @@ if [[ $V_FLAG -ge 3 ]]; then
|
|||||||
echo "$0: debug[3]: VERSION=$VERSION" 1>&2
|
echo "$0: debug[3]: VERSION=$VERSION" 1>&2
|
||||||
echo "$0: debug[3]: NAME=$NAME" 1>&2
|
echo "$0: debug[3]: NAME=$NAME" 1>&2
|
||||||
echo "$0: debug[3]: V_FLAG=$V_FLAG" 1>&2
|
echo "$0: debug[3]: V_FLAG=$V_FLAG" 1>&2
|
||||||
echo "$0: debug[3]: PANDOC_TOOL=$PANDOC_TOOL" 1>&2
|
echo "$0: debug[3]: EXPAND_TOOL=$EXPAND_TOOL" 1>&2
|
||||||
echo "$0: debug[3]: GIT_TOOL=$GIT_TOOL" 1>&2
|
echo "$0: debug[3]: GIT_TOOL=$GIT_TOOL" 1>&2
|
||||||
|
echo "$0: debug[3]: PANDOC_TOOL=$PANDOC_TOOL" 1>&2
|
||||||
echo "$0: debug[3]: TOPDIR=$TOPDIR" 1>&2
|
echo "$0: debug[3]: TOPDIR=$TOPDIR" 1>&2
|
||||||
echo "$0: debug[3]: PANDOC_TOOL=$PANDOC_TOOL" 1>&2
|
echo "$0: debug[3]: PANDOC_TOOL=$PANDOC_TOOL" 1>&2
|
||||||
for index in "${!PANDOC_OPTION[@]}"; do
|
for index in "${!PANDOC_OPTION[@]}"; do
|
||||||
@@ -400,16 +407,16 @@ fi
|
|||||||
#
|
#
|
||||||
if [[ -z $NOOP ]]; then
|
if [[ -z $NOOP ]]; then
|
||||||
if [[ $V_FLAG -ge 1 ]]; then
|
if [[ $V_FLAG -ge 1 ]]; then
|
||||||
echo "$0: debug[1]: will execute pandoc as: $PANDOC_TOOL ${PANDOC_OPTION[*]} -o $HTML_OUTPUT $MARKDOWN_INPUT" 1>&2
|
echo "$0: debug[1]: will execute pandoc as: $EXPAND_TOOL -t 8 -- $MARKDOWN_INPUT | $PANDOC_TOOL ${PANDOC_OPTION[*]} -o $HTML_OUTPUT" 1>&2
|
||||||
fi
|
fi
|
||||||
"$PANDOC_TOOL" "${PANDOC_OPTION[@]}" -o "$HTML_OUTPUT" "$MARKDOWN_INPUT"
|
"$EXPAND_TOOL" -t 8 -- "$MARKDOWN_INPUT" | "$PANDOC_TOOL" "${PANDOC_OPTION[@]}" -o "$HTML_OUTPUT"
|
||||||
status="$?"
|
status="${PIPESTATUS[1]}"
|
||||||
else
|
else
|
||||||
if [[ $V_FLAG -ge 1 ]]; then
|
if [[ $V_FLAG -ge 1 ]]; then
|
||||||
echo "$0: debug[3]: will execute pandoc as: $PANDOC_TOOL ${PANDOC_OPTION[*]} -o /dev/null $MARKDOWN_INPUT" 1>&2
|
echo "$0: debug[3]: will execute pandoc as: $EXPAND_TOOL -t 8 -- $MARKDOWN_INPUT | $PANDOC_TOOL ${PANDOC_OPTION[*]} -o /dev/null" 1>&2
|
||||||
fi
|
fi
|
||||||
"$PANDOC_TOOL" "${PANDOC_OPTION[*]}" -o /dev/null "$MARKDOWN_INPUT"
|
"$EXPAND_TOOL" -t 8 -- "$MARKDOWN_INPUT" | "$PANDOC_TOOL" "${PANDOC_OPTION[*]}" -o /dev/null "$MARKDOWN_INPUT"
|
||||||
status="$?"
|
status="${PIPESTATUS[1]}"
|
||||||
fi
|
fi
|
||||||
if [[ $status -ne 0 ]]; then
|
if [[ $status -ne 0 ]]; then
|
||||||
echo "$0: ERROR: pandoc: $PANDOC_TOOL exited non-zero: $status" 1>&2
|
echo "$0: ERROR: pandoc: $PANDOC_TOOL exited non-zero: $status" 1>&2
|
||||||
|
|||||||
@@ -960,7 +960,7 @@ test the entry one can do:</p>
|
|||||||
sentence.</p>
|
sentence.</p>
|
||||||
<p>But doing this shows instead:</p>
|
<p>But doing this shows instead:</p>
|
||||||
<pre><code> echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
|
<pre><code> echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
|
||||||
a얖?)V...?????777??hC??h??-? )SSSSXXX????r?L=???*?-???ppp,,,?R
|
a얖?)V...?????777??hC??h??-? )SSSSXXX????r?L=???*?-???ppp,,,?R
|
||||||
?j
|
?j
|
||||||
111-)))? '..F@E
|
111-)))? '..F@E
|
||||||
???b111?
|
???b111?
|
||||||
|
|||||||
Reference in new issue
Block a user