Closes 3937 It's unclear which change fixed the `format_code_in_doc_comments=true` issue brought up in this issue, however I'm unable to reproduce the error on the current master. The added test cases should serve to prevent a regression.