Reference-style links and footnotes will not work if there is a code block between them:
This [reference link][link1] and footnote[^fn2] will not work.
~~~
some code here
~~~
[link1]: http://example.com
[^fn2]: A footnote
Workaround is to use only inline links or place the reference definition closer to the source where possible.
However for footnotes there is no workaround as they will be rendered too early (at the end of the current text block, before the next code block) if placed anywhere except the end of the document.