summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmakehtml.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/makehtml.sh b/makehtml.sh
index 2ca387b..cad297c 100755
--- a/makehtml.sh
+++ b/makehtml.sh
@@ -19,17 +19,29 @@ sed 's/>~/>"/g' $SPECDOC.tmp2 >$SPECDOC.tmp3
sed 's/>=~/>="/g' $SPECDOC.tmp3 >$SPECDOC.tmp4
sed 's/~</"</g' $SPECDOC.tmp4 >$SPECDOC.tmp5
-#For some unclear reason we get 'fi' replaced by NULL character
-# on Fedora. file recognizes result as a binary data.
-# Detect and work around this.
+# If font paths are misconfigured, we get ligatures
+# (such as 'ff or 'fi') replaced by NULL character in output.
+# This in not a valid HTML output, so detect this and warn user.
+# For detection, we rely on the fact that file utility
+# recognizes files with NULL characters as binary data.
if test `file -b $SPECDOC.tmp5` = 'data';
then
- perl -p -e 's/\0/fi/g' $SPECDOC.tmp5 >$SPECDOC.tmp6
-else
- cp $SPECDOC.tmp5 $SPECDOC.tmp6
+ echo
+ echo WARNING!
+ echo
+ echo NULL characters detected in file output.
+ echo This is likely due to tex4ht being unable to find font files.
+ echo If installed, you might need to fix font file paths
+ echo for tex4ht by locating tex4ht.env file in your setup
+ echo correcting font file paths there and copying it to
+ echo tex4ht.env or .tex4ht in your home directory.
+ echo
+ echo WARNING!
+ echo Proceeding but HTML output appears to be malformed.
+ echo
fi
-mv $SPECDOC.tmp6 $SPECDOC.html
+mv $SPECDOC.tmp5 $SPECDOC.html
rm $SPECDOC.tmp*
#uncomment if you have a broken t4ht