diff --git a/markdown_it/common/entities.py b/markdown_it/common/entities.py index c05e5751..1eea4492 100644 --- a/markdown_it/common/entities.py +++ b/markdown_it/common/entities.py @@ -1,9 +1,5 @@ """HTML5 entities map: { name -> characters }.""" import html.entities -from markdown_it.utils import AttrDict - -DATA = {name.rstrip(";"): chars for name, chars in html.entities.html5.items()} - -entities = AttrDict(DATA) +entities = {name.rstrip(";"): chars for name, chars in html.entities.html5.items()} diff --git a/markdown_it/utils.py b/markdown_it/utils.py index 605a39d3..5d1ce723 100644 --- a/markdown_it/utils.py +++ b/markdown_it/utils.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import TYPE_CHECKING, Any, Callable, List, Optional, Union +from typing import Callable, List, Optional, Union class OptionsDict(dict): @@ -87,21 +87,6 @@ def highlight(self, value: Optional[Callable[[str, str, str], str]]): self["highlight"] = value -if TYPE_CHECKING: - AttrDict = Any -else: - - class AttrDict(dict): - def __init__(self, *args, **kwargs): - super(AttrDict, self).__init__(*args, **kwargs) - self.__dict__ = self - - # recursively apply to all nested dictionaries - for key, item in list(self.items()): - if isinstance(item, dict): - self[key] = AttrDict(item) - - def read_fixture_file(path: Union[str, Path]) -> List[list]: text = Path(path).read_text(encoding="utf-8") tests = []