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

This commit is contained in:
Alexey Shpakovsky 2014-06-26 04:08:31 +02:00 committed by Aleksei Shpakovskii
parent 840d24c4ac
commit 555db3167f

13
bb.sh
View File

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