瀏覽代碼

use markdown by default (if available) when posting with `bb.sh post`

Alexey Shpakovsky 11 年之前
父節點
當前提交
555db3167f
共有 1 個文件被更改,包括 3 次插入10 次删除
  1. 3 10
      bb.sh

+ 3 - 10
bb.sh

@@ -583,16 +583,9 @@ parse_file() {
 # Manages the creation of the text file and the parsing to html file
 # also the drafts
 write_entry() {
-    fmt="html"; f="$2"
-    [[ "$2" == "-m" ]] && fmt="md" && f="$3"
-    if [[ "$fmt" == "md" ]]; then
-        test_markdown
-        if [[ "$?" -ne 0 ]]; then
-            echo "Markdown is not working, please use HTML. Press a key to continue..."
-            fmt="html" 
-            read 
-        fi
-    fi
+    test_markdown && fmt="md" || fmt="html"
+    f="$2"
+    [[ "$2" == "-html" ]] && fmt="html" && f="$3"
 
     if [[ "$f" != "" ]]; then
         TMPFILE="$f"