From 961075afd23cdb1db72290b31d34b6e986db85c4 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 3 Jun 2020 15:00:08 +1200 Subject: [PATCH] Improve pre-leanpub parsing --- scripts/markdown-to-markua.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/markdown-to-markua.sh b/scripts/markdown-to-markua.sh index b51768f..4274863 100755 --- a/scripts/markdown-to-markua.sh +++ b/scripts/markdown-to-markua.sh @@ -10,6 +10,12 @@ do # Can't use relative paths in a book, so make all paths static sed -i 's/](\//\](https:\/\/geek-cookbook.funkypenguin.co.nz\//g' $file + # GitHub emojis look beautiful but don't render nicely + sed -i 's/:[a-z\ ]://g' $file + + # Animated gifs make leanpub fail, so strip 'em out by deleting the entire line + sed -i '/.gif/d' $file + # strip emojis tr -cd '\11\12\15\40-\176' < $file > $file-clean mv $file-clean $file