Skip to content

Commit db1dcc9

Browse files
committed
html -> unicode
1 parent 34bf4f5 commit db1dcc9

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

elementary/messages/formats/adaptive_cards.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
TextStyle,
2222
WhitespaceBlock,
2323
)
24-
from elementary.messages.formats.html import ICON_TO_HTML
24+
from elementary.messages.formats.unicode import ICON_TO_UNICODE
2525
from elementary.messages.message_body import Color, MessageBlock, MessageBody
2626

2727
COLOR_TO_STYLE = {
@@ -32,7 +32,7 @@
3232

3333

3434
def format_icon(icon: Icon) -> str:
35-
return ICON_TO_HTML[icon]
35+
return ICON_TO_UNICODE[icon]
3636

3737

3838
def format_text_block(block: TextBlock) -> str:

elementary/messages/formats/block_kit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
UserSelectActionBlock,
3030
WhitespaceBlock,
3131
)
32-
from elementary.messages.formats.html import ICON_TO_HTML
32+
from elementary.messages.formats.unicode import ICON_TO_UNICODE
3333
from elementary.messages.message_body import Color, MessageBlock, MessageBody
3434

3535
COLOR_MAP = {
@@ -61,7 +61,7 @@ def __init__(
6161
self._resolve_mention = resolve_mention or (lambda x: None)
6262

6363
def _format_icon(self, icon: Icon) -> str:
64-
return ICON_TO_HTML[icon]
64+
return ICON_TO_UNICODE[icon]
6565

6666
def _format_text_block(self, block: TextBlock) -> str:
6767
if block.style == TextStyle.BOLD:

elementary/messages/formats/markdown.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
TextStyle,
2525
WhitespaceBlock,
2626
)
27-
from elementary.messages.formats.html import ICON_TO_HTML
27+
from elementary.messages.formats.unicode import ICON_TO_UNICODE
2828
from elementary.messages.message_body import MessageBlock, MessageBody
2929

3030

@@ -38,7 +38,7 @@ def __init__(self, table_style: TableStyle):
3838
self._table_style = table_style
3939

4040
def format_icon(self, icon: Icon) -> str:
41-
return ICON_TO_HTML[icon]
41+
return ICON_TO_UNICODE[icon]
4242

4343
def format_text_block(self, block: TextBlock) -> str:
4444
if block.style == TextStyle.BOLD:

elementary/messages/formats/text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
TextBlock,
2424
WhitespaceBlock,
2525
)
26-
from elementary.messages.formats.html import ICON_TO_HTML
26+
from elementary.messages.formats.unicode import ICON_TO_UNICODE
2727
from elementary.messages.message_body import MessageBlock, MessageBody
2828

2929

@@ -47,7 +47,7 @@ def format_icon(self, icon: Icon) -> str:
4747
if self._icon_style == IconStyle.OMIT:
4848
return ""
4949
elif self._icon_style == IconStyle.UNICODE:
50-
return ICON_TO_HTML[icon]
50+
return ICON_TO_UNICODE[icon]
5151
elif self._icon_style == IconStyle.NAME:
5252
return f":{icon.value}:"
5353
else:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from elementary.messages.blocks import Icon
22

3-
ICON_TO_HTML = {
3+
ICON_TO_UNICODE = {
44
Icon.RED_TRIANGLE: "🔺",
55
Icon.X: "❌",
66
Icon.WARNING: "⚠️",
@@ -18,5 +18,5 @@
1818
}
1919

2020
for icon in Icon:
21-
if icon not in ICON_TO_HTML:
22-
raise RuntimeError(f"No HTML representation for icon {icon}")
21+
if icon not in ICON_TO_UNICODE:
22+
raise RuntimeError(f"No unicode representation for icon {icon}")

0 commit comments

Comments
 (0)