. tests/functions.sh title "code blocks" rc=0 MARKDOWN_FLAGS= try 'format for code block html' \ ' this is code' \ '
this is
code
'
try 'mismatched backticks' '```tick``' '`tick
``tick```
' try 'unclosed single backtick' '`hi there' '`hi there
' try 'unclosed double backtick' '``hi there' '``hi there
' try 'triple backticks' '```hi there```' 'hi there
hi there
hi there
a```b
a\
>
`
``
`
`` `
printf "%s: \n", $1;
'
try 'backslashes in code(2)' '`printf "%s: \n", $1;`' \
'printf "%s: \n", $1;
code!
'
try 'fenced code block in list' \
'1. ~~~
code block
~~~' \
'code block
' try 'unterminated fenced code block' \ '~~~ code' \ 'code
~~~ code
' try 'fenced code block with tildes' \ '~~~~~ ~~~ code with tildes ~~~ ~~~~~' \ '~~~
code with tildes
~~~
'
try 'paragraph with trailing fenced block' \
'text text text
text text text
~~~
code code code?
~~~' \
'text text text text text text ~~~ code code code? ~~~
' try 'fenced code blocks with backtick delimiters' \ '``` code ```' \ 'code
'
try 'fenced code block with mismatched delimters' \
'```
code
~~~' \
'``` code ~~~
' fi summary $0 exit $rc