@@ -265,23 +265,21 @@ def _process_start_markers(
265265 verbose : bool = False , # noqa: FBT001, FBT002, ARG002
266266 ) -> str | None :
267267 for marker_name in MARKERS :
268- if marker_name .endswith (":start" ):
269- match = is_marker (line , marker_name )
270- if match :
271- # reset output in case previous output wasn't displayed
272- self .output = None
273- self .backtick_options = _extract_backtick_options (line )
274- self .section , _ = marker_name .rsplit (":" , 1 ) # type: ignore[assignment]
275- self .indent = match .group ("spaces" )
276-
277- # Standardize backticks if needed
278- if (
279- marker_name == "code:backticks:start"
280- and self .backtick_standardize
281- and "markdown-code-runner" in line
282- ):
283- return re .sub (r"\smarkdown-code-runner.*" , "" , line )
284- return line
268+ if marker_name .endswith (":start" ) and is_marker (line , marker_name ):
269+ # reset output in case previous output wasn't displayed
270+ self .output = None
271+ self .backtick_options = _extract_backtick_options (line )
272+ self .section , _ = marker_name .rsplit (":" , 1 ) # type: ignore[assignment]
273+ self .indent = self ._get_indent (line )
274+
275+ # Standardize backticks if needed
276+ if (
277+ marker_name == "code:backticks:start"
278+ and self .backtick_standardize
279+ and "markdown-code-runner" in line
280+ ):
281+ return re .sub (r"\smarkdown-code-runner.*" , "" , line )
282+ return line
285283 return None
286284
287285 @staticmethod
0 commit comments