Skip to content

Commit 8431b9c

Browse files
committed
fix(slug): remove all Supplemental Symbols in slug
Fix the `slug` function to remove *all* emojis in the Supplemental Symbols and Pictographs Unicode block. I'm not sure why originally only a partial range was removed, but this change seems to align with GitHub-flavored Markdown. While this will effectively fix issue #5998, it does not address the underlying problem where slugs were never designed for widget IDs.
1 parent 7c2b65f commit 8431b9c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/textual/_slug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
r"\U0001F300-\U0001F5FF"
3838
r"\U0001F600-\U0001F64F"
3939
r"\U0001F680-\U0001F6FF"
40-
r"\U0001f926-\U0001f937"
40+
r"\U0001F900-\U0001f9FF"
4141
r"\u200D"
4242
r"\u2640-\u2642"
4343
)

tests/test_slug.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
("test🙂test", "testtest"),
2626
("test🤷test", "testtest"),
2727
("test🤷🏻‍♀️test", "testtest"),
28+
("test🤖test", "testtest"),
29+
("test🧠test", "testtest"),
2830
],
2931
)
3032
def test_simple_slug(text: str, expected: str) -> None:

0 commit comments

Comments
 (0)