Parcourir la source

test markdown before editing *.md files

Alexey Shpakovsky il y a 11 ans
Parent
commit
39c4a80cec
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      bb.sh

+ 5 - 0
bb.sh

@@ -361,6 +361,11 @@ edit() {
         filename="$1"
     else
         if [[ "${1##*.}" == "md" ]]; then
+            test_markdown
+            if [[ "$?" -ne 0 ]]; then
+                echo "Markdown is not working, please edit HTML file directly."
+                exit
+            fi
             # editing markdown file
             $EDITOR "$1"
             TMPFILE="$(markdown "$1")"