docs: fix mdx codefences (#26802)

```
git grep -l -E '"```\{=mdx\}\\n",' | xargs perl -0777 -i -pe 's/"```\{=mdx\}\\n",\n    (\W.*?),\n\s*"```\\?n?"/$1/s'
```
This commit is contained in:
Erick Friis
2024-09-23 23:06:13 -07:00
committed by GitHub
parent 35081d2765
commit e40a2b8bbf
68 changed files with 66 additions and 221 deletions

View File

@@ -13,11 +13,6 @@ from nbconvert.preprocessors import Preprocessor
class EscapePreprocessor(Preprocessor):
def preprocess_cell(self, cell, resources, cell_index):
if cell.cell_type == "markdown":
# find all occurrences of ```{=mdx} blocks and remove wrapper
if "```{=mdx}\n" in cell.source:
cell.source = re.sub(
r"```{=mdx}\n(.*?)\n```", r"\1", cell.source, flags=re.DOTALL
)
# rewrite .ipynb links to .md
cell.source = re.sub(
r"\[([^\]]*)\]\((?![^\)]*//)([^)]*)\.ipynb\)",