(self, lines: list[str])
| 878 | self.base_path = base_path |
| 879 | |
| 880 | def run(self, lines: list[str]) -> list[str]: |
| 881 | for i, line in enumerate(lines): |
| 882 | if m := re.search(r'^--8<-- "(.+)"$', line): |
| 883 | try: |
| 884 | lines[i] = Path(self.base_path, m[1]).read_text() |
| 885 | except OSError: |
| 886 | lines[i] = f"(Failed to read {m[1]!r})\n" |
| 887 | return lines |
| 888 | |
| 889 | |
| 890 | class _TestExtension(markdown.extensions.Extension): |
no outgoing calls
no test coverage detected