(text: str)
| 605 | |
| 606 | |
| 607 | def _find_doubled_backticks(text: str) -> list[int]: |
| 608 | length = len(text) |
| 609 | doubled_backtick_positions: list[int] = [] |
| 610 | backtick = '`' |
| 611 | two_backticks = backtick + backtick |
| 612 | |
| 613 | if two_backticks not in text: |
| 614 | return doubled_backtick_positions |
| 615 | |
| 616 | for index in range(0, length): |
| 617 | ch = text[index] |
| 618 | if ch != backtick: |
| 619 | index += 1 |
| 620 | continue |
| 621 | if index + 1 < length and text[index + 1] == backtick: |
| 622 | doubled_backtick_positions.append(index) |
| 623 | doubled_backtick_positions.append(index + 1) |
| 624 | index += 2 |
| 625 | continue |
| 626 | index += 1 |
| 627 | |
| 628 | return doubled_backtick_positions |
| 629 | |
| 630 | |
| 631 | @functools.lru_cache(maxsize=128) |
no outgoing calls