Files
discount/tests/code.t
T
David Parsons ebdd489ed7 1. Fix a bug in generate.c where MKD_NO_EXT was not being handled.
2. Add -fext to the options for the markdown program
3. `try`ify a bunch more of the test cases.
2009-06-17 14:30:43 -07:00

40 lines
687 B
Raku

./echo "code blocks"
rc=0
MARKDOWN_FLAGS=
try() {
unset FLAGS
case "$1" in
-*) FLAGS=$1
shift ;;
esac
./echo -n " $1" '..................................' | ./cols 36
Q=`./echo "$2" | ./markdown $FLAGS`
if [ "$3" = "$Q" ]; then
./echo " ok"
else
./echo " FAILED"
./echo "wanted: $3"
./echo "got : $Q"
rc=1
fi
}
try 'format for code block html' \
' this is
code' \
'<pre><code>this is
code
</code></pre>'
try 'unclosed single backtick' '`hi there' '<p>`hi there</p>'
try 'unclosed double backtick' '``hi there' '<p>``hi there</p>'
try 'remove space around code' '`` hi there ``' '<p><code>hi there</code></p>'
exit $rc