-
Notifications
You must be signed in to change notification settings - Fork 6
/
xml.t
39 lines (31 loc) · 998 Bytes
/
xml.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
./echo "xml output with MKD_CDATA"
rc=0
MARKDOWN_FLAGS=
try() {
unset FLAGS
case "$1" in
-*) FLAGS=$1
shift ;;
esac
./echo -n " $1" '..................................' | ./cols 36
case "$2" in
-t*) Q=`./markdown $FLAGS "$2"` ;;
*) Q=`./echo "$2" | ./markdown $FLAGS` ;;
esac
if [ "$3" = "$Q" ]; then
./echo " ok"
else
./echo " FAILED"
./echo "wanted: $3"
./echo "got : $Q"
rc=1
fi
}
try -fcdata 'xml output from markdown()' 'hello,sailor' '<p>hello,sailor</p>'
try -fcdata 'from mkd_generateline()' -t'"hello,sailor"' '&ldquo;hello,sailor&rdquo;'
try -fnocdata 'html output from markdown()' '"hello,sailor"' '<p>“hello,sailor”</p>'
try -fnocdata '... from mkd_generateline()' -t'"hello,sailor"' '“hello,sailor”'
try -fcdata 'xml output with multibyte utf-8' \
'tecnología y servicios más confiables' \
'<p>tecnología y servicios más confiables</p>'
exit $rc