Fix link target markup

This markup for a code block is redundant with the code-block directive below,
and blocks the following line from working as link target.
Fix malformed note directives.
Fixed #23799 -- Made makemigrations respect --no-optimize.

Thanks to yamila-moreno for the idea of a skip message.