Skip to content

Commit b6620c3

Browse files
committed
Fix naming
1 parent bb9ae69 commit b6620c3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

telebot/formatting.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def apply_html_entities(text: str, entities: Optional[List]=None, custom_subs: O
381381
if not entities:
382382
return text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
383383

384-
_subs_c = {
384+
_subs = {
385385
"bold": "<b>{text}</b>",
386386
"italic": "<i>{text}</i>",
387387
"pre": "<pre>{text}</pre>",
@@ -397,7 +397,7 @@ def apply_html_entities(text: str, entities: Optional[List]=None, custom_subs: O
397397

398398
if custom_subs:
399399
for key, value in custom_subs.items():
400-
_subs_c[key] = value
400+
_subs[key] = value
401401

402402
# Sort entities by offset (starting position), with longer entities first for equal offsets
403403
sorted_entities = sorted(entities, key=lambda e: (e.offset, -e.length))
@@ -427,8 +427,8 @@ def format_entity(entity, content):
427427
return f"<tg-emoji emoji-id=\"{entity.custom_emoji_id}\">{content}</tg-emoji>"
428428
elif entity_type == "pre" and hasattr(entity, 'language') and entity.language:
429429
return f"<pre><code class=\"language-{entity.language}\">{content}</code></pre>"
430-
elif entity_type in _subs_c:
431-
template = _subs_c[entity_type]
430+
elif entity_type in _subs:
431+
template = _subs[entity_type]
432432
return template.format(text=content)
433433

434434
# If no matching entity type, return text as is

0 commit comments

Comments
 (0)