(app, state)
| 603 | |
| 604 | heading_match = None if in_code_fence else re.match(r"^(#{1,6})\s+(.*)$", stripped) |
| 605 | if heading_match: |
| 606 | level = len(heading_match.group(1)) |
| 607 | marker = detect_language_label(heading_match.group(2)) |
| 608 | |
| 609 | if skip_level is not None: |
| 610 | if level > skip_level: |
| 611 | continue |
| 612 | skip_level = None |
| 613 | |
| 614 | if marker == opposite: |
| 615 | skip_level = level |
| 616 | continue |
| 617 | if marker == target: |
| 618 | continue |
| 619 | |
| 620 | if skip_level is None: |
| 621 | output.append(line) |
| 622 | |
| 623 | return "\n".join(output).strip() |
| 624 | |
| 625 | |
| 626 | def dominant_text_language(text): |
no test coverage detected