(base_path)
| 551 | in_code_fence = not in_code_fence |
| 552 | if active_language == target: |
| 553 | output.append(line) |
| 554 | elif active_language is None: |
| 555 | pending_shared.append(line) |
| 556 | continue |
| 557 | |
| 558 | marker = None if in_code_fence else detect_language_label( |
| 559 | re.sub(r"^#{1,6}\s+", "", stripped) |
| 560 | ) |
| 561 | if marker: |
| 562 | active_language = marker |
| 563 | if marker == target and pending_shared: |
| 564 | output.extend(pending_shared) |