Skip to content

Commit

Permalink
ci: Ignore type warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jan 5, 2024
1 parent 8de8548 commit 8fd1ab5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/markdown_exec/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def run(self, root: Element) -> None: # noqa: D102
el = copy.copy(el) # noqa: PLW2901
# 'toc' extension's first pass (which we require to build heading stubs/ids) also edits the HTML.
# Undo the permalink edit so we can pass this heading to the outer pass of the 'toc' extension.
if len(el) > 0 and el[-1].get("class") == self.md.treeprocessors["toc"].permalink_class:
if len(el) > 0 and el[-1].get("class") == self.md.treeprocessors["toc"].permalink_class: # type: ignore[attr-defined]
del el[-1]
self.headings.append(el)

Expand Down
6 changes: 3 additions & 3 deletions src/markdown_exec/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ def _mimic(md: Markdown, headings: list[Element], *, update_toc: bool = True) ->
def _id_prefix(md: Markdown, prefix: str | None) -> Iterator[None]:
MarkdownConverter.counter += 1
id_prepending_processor = md.treeprocessors[IdPrependingTreeprocessor.name]
id_prepending_processor.id_prefix = prefix if prefix is not None else f"exec-{MarkdownConverter.counter}--"
id_prepending_processor.id_prefix = prefix if prefix is not None else f"exec-{MarkdownConverter.counter}--" # type: ignore[attr-defined]
try:
yield
finally:
id_prepending_processor.id_prefix = ""
id_prepending_processor.id_prefix = "" # type: ignore[attr-defined]


class MarkdownConverter:
Expand All @@ -243,7 +243,7 @@ def _original_md(self) -> Markdown:
return getattr(self._md_ref, "_original_md", self._md_ref)

def _report_headings(self, markup: Markup) -> None:
self._original_md.treeprocessors[InsertHeadings.name].headings[markup] = self._headings
self._original_md.treeprocessors[InsertHeadings.name].headings[markup] = self._headings # type: ignore[attr-defined]
self._headings = []

def convert(self, text: str, stash: dict[str, str] | None = None, id_prefix: str | None = None) -> Markup:
Expand Down

0 comments on commit 8fd1ab5

Please sign in to comment.