. tests/functions.sh
title "definition lists"
eval `./markdown -V | tr ' ' '\n' | grep '^DL='`
DL=${DL:-BOTH}
rc=0
MARKDOWN_FLAGS=
SRC='
=this=
is an ugly
=test=
eh?'
RSLT='
- this
- is an ugly
- test
- eh?
'
if [ "$DL" = "DISCOUNT" -o "$DL" = "BOTH" ]; then
try -fdefinitionlist '=tag= generates definition lists' "$SRC" "$RSLT"
try 'one item with two =tags=' \
'=this=
=is=
A test, eh?' \
'
- this
- is
- A test, eh?
'
try -fnodefinitionlist '=tag= does nothing' "$SRC" \
'=this=
is an ugly
=test=
eh?
'
fi
if [ "$DL" = "EXTRA" -o "$DL" = "BOTH" ]; then
try 'markdown extra-style definition lists' \
'foo
: bar' \
'
- foo
- bar
'
try '... with two s in a row' \
'foo
bar
: baz' \
'
- foo
- bar
- baz
'
try '... with two s in a row' \
'foo
: bar
: baz' \
'
- foo
- bar
- baz
'
try '... with blanks between list items' \
'foo
: bar
zip
: zap' \
'
- foo
- bar
- zip
- zap
'
fi
summary $0
exit $rc