From: 
Subject: Debian changes

The Debian packaging of python-m2r2 is maintained in git, using a workflow
similar to the one described in dgit-maint-merge(7).
The Debian delta is represented by this one combined patch; there isn't a
patch queue that can be represented as a quilt series.

A detailed breakdown of the changes is available from their canonical
representation -- git commits in the packaging repository.
For example, to see the changes made by the Debian maintainer in the first
upload of upstream version 1.2.3, you could use:

    % git clone https://git.dgit.debian.org/python-m2r2
    % cd python-m2r2
    % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'

(If you have dgit, use `dgit clone python-m2r2`, rather than plain `git clone`.)

We don't use debian/source/options single-debian-patch because it has bugs.
Therefore, NMUs etc. may nevertheless have made additional patches.

---

diff --git a/m2r2/rst/plugins.py b/m2r2/rst/plugins.py
index 451daae..5823bc6 100644
--- a/m2r2/rst/plugins.py
+++ b/m2r2/rst/plugins.py
@@ -270,6 +270,24 @@ def configure_markdown_parser_for_rst(
         parse_directive,
         before="indent_code",
     )
+
+    # Mistune >= 3.4 runs a fast path for indented code before any block rule
+    # is consulted, so it would swallow indented RST directives such as
+    # "    .. foo" as literal code even though the directive rules above are
+    # registered ahead of the indented-code rule. Disable that fast path by
+    # renaming the indented-code rule: the fast path only triggers for a rule
+    # named "indent_code", and the ordinary rule it replaces is registered
+    # below, still after the directive rules so directives keep priority.
+    rules = markdown.block.rules
+    if "indent_code" in rules:
+        rules.remove("indent_code")
+        markdown.block.register(
+            "indented_code",
+            markdown.block.specification["indent_code"],
+            type(markdown.block).parse_indent_code,
+            before="atx_heading",
+        )
+
     markdown.block.register(
         "rest_code_block",
         r"^(?P<code_block>::\s*)$",
