Skip to content

Commit

Permalink
Fix types in markdown_mistune.py for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagodePAlves committed Jun 16, 2023
1 parent a1aa9dd commit f5df25c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nbconvert/filters/markdown_mistune.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import mimetypes
import os
from html import escape
from typing import Any, Callable, Iterable, LiteralString, Match, Optional
from typing import Any, Callable, Dict, Iterable, Match, Optional

import bs4
from mistune import (
Expand All @@ -37,7 +37,7 @@ class InvalidNotebook(Exception): # noqa
pass


def _dotall(pattern: LiteralString) -> LiteralString:
def _dotall(pattern: str) -> str:
"""Makes the '.' special character match any character inside the pattern, including a newline.
This is implemented with the inline flag `(?s:...)` and is equivalent to using `re.DOTALL`.
Expand Down Expand Up @@ -164,7 +164,7 @@ def __init__( # noqa
exclude_anchor_links: bool = False,
anchor_link_text: str = "¶",
path: str = "",
attachments: Optional[dict[str, dict[str, str]]] = None,
attachments: Optional[Dict[str, Dict[str, str]]] = None,
):
"""Initialize the renderer."""
super().__init__(escape, allow_harmful_protocols)
Expand Down Expand Up @@ -221,7 +221,7 @@ def inline_html(self, html: str) -> str:

return super().inline_html(html)

def heading(self, text: str, level: int, **attrs: dict[str, Any]) -> str:
def heading(self, text: str, level: int, **attrs: Dict[str, Any]) -> str:
"""Handle a heading."""
html = super().heading(text, level, **attrs)
if self.exclude_anchor_links:
Expand Down

0 comments on commit f5df25c

Please sign in to comment.