We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
_Entities
AttrDict
1 parent 5ef2bd7 commit 2eb1fe6Copy full SHA for 2eb1fe6
markdown_it/common/entities.py
@@ -1,21 +1,9 @@
1
"""HTML5 entities map: { name -> characters }."""
2
import html.entities
3
4
+from markdown_it.utils import AttrDict
5
-class _Entities:
6
- def __getattr__(self, name):
7
- try:
8
- return DATA[name]
9
- except KeyError:
10
- raise AttributeError(name)
11
-
12
- def __getitem__(self, name):
13
14
15
- def __contains__(self, name):
16
- return name in DATA
17
18
19
-entities = _Entities()
20
21
DATA = {name.rstrip(";"): chars for name, chars in html.entities.html5.items()}
+
+entities = AttrDict(DATA)
0 commit comments