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.
1 parent 449a901 commit b921113Copy full SHA for b921113
1 file changed
pyrogram/parser/specs.py
@@ -1,5 +1,6 @@
1
from __future__ import annotations
2
3
+from abc import ABC, abstractmethod
4
import html
5
from typing import Dict, Optional
6
@@ -9,7 +10,7 @@
9
10
from .types import EntityMeta
11
12
-class EntitySpec:
13
+class EntitySpec(ABC):
14
entity_type: Optional[enums.MessageEntityType] = None
15
html_tags: tuple[str, ...] = ()
16
@@ -39,9 +40,11 @@ def create_entity(
39
40
**payload
41
)
42
43
+ @abstractmethod
44
def render_html(self, content: str, entity: MessageEntity) -> str:
45
raise NotImplementedError
46
47
48
def render_markdown(self, content: str, entity: MessageEntity) -> str:
49
50
0 commit comments