@@ -67,7 +67,7 @@ a comma-separated list of group names.
6767 default set of flags is specified by the :confval: `doctest_default_flags `
6868 configuration variable.
6969
70- This directive supports three options:
70+ This directive supports five options:
7171
7272 * ``hide ``, a flag option, hides the doctest block in other builders. By
7373 default it is shown as a highlighted doctest block.
@@ -102,6 +102,11 @@ a comma-separated list of group names.
102102
103103 Supported PEP-440 operands and notations
104104
105+ * ``trim-doctest-flags `` and ``no-trim-doctest-flags ``, a flag option,
106+ doctest flags (comments looking like ``# doctest: FLAG, ... ``) at the
107+ ends of lines and ``<BLANKLINE> `` markers are removed (or not removed)
108+ individually. Default is ``trim-doctest-flags ``.
109+
105110 Note that like with standard doctests, you have to use ``<BLANKLINE> `` to
106111 signal a blank line in the expected output. The ``<BLANKLINE> `` is removed
107112 when building presentation output (HTML, LaTeX etc.).
@@ -119,11 +124,16 @@ a comma-separated list of group names.
119124
120125 A code block for a code-output-style test.
121126
122- This directive supports one option :
127+ This directive supports three options :
123128
124129 * ``hide ``, a flag option, hides the code block in other builders. By
125130 default it is shown as a highlighted code block.
126131
132+ * ``trim-doctest-flags `` and ``no-trim-doctest-flags ``, a flag option,
133+ doctest flags (comments looking like ``# doctest: FLAG, ... ``) at the
134+ ends of lines and ``<BLANKLINE> `` markers are removed (or not removed)
135+ individually. Default is ``trim-doctest-flags ``.
136+
127137 .. note ::
128138
129139 Code in a ``testcode `` block is always executed all at once, no matter how
@@ -149,14 +159,19 @@ a comma-separated list of group names.
149159 The corresponding output, or the exception message, for the last
150160 :rst:dir: `testcode ` block.
151161
152- This directive supports two options:
162+ This directive supports four options:
153163
154164 * ``hide ``, a flag option, hides the output block in other builders. By
155165 default it is shown as a literal block without highlighting.
156166
157167 * ``options ``, a string option, can be used to give doctest flags
158168 (comma-separated) just like in normal doctest blocks.
159169
170+ * ``trim-doctest-flags `` and ``no-trim-doctest-flags ``, a flag option,
171+ doctest flags (comments looking like ``# doctest: FLAG, ... ``) at the
172+ ends of lines and ``<BLANKLINE> `` markers are removed (or not removed)
173+ individually. Default is ``trim-doctest-flags ``.
174+
160175 Example::
161176
162177 .. testcode::
0 commit comments