fix parsing reST with code or code-block directives (closes #23063)

Patch by Marc Abramowitz.
3 files changed