mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 04:52:30 +00:00
Prioritise closing tags when sorting tags
This commit is contained in:
@@ -53,6 +53,22 @@ def test_entities_together():
|
||||
assert text == original
|
||||
|
||||
|
||||
def test_nested_entities():
|
||||
"""
|
||||
Test that an entity nested inside another one behaves well.
|
||||
"""
|
||||
original = '<a href="https://example.com"><strong>Example</strong></a>'
|
||||
original_entities = [MessageEntityTextUrl(0, 7, url='https://example.com'), MessageEntityBold(0, 7)]
|
||||
stripped = 'Example'
|
||||
|
||||
text, entities = html.parse(original)
|
||||
assert text == stripped
|
||||
assert entities == original_entities
|
||||
|
||||
text = html.unparse(text, entities)
|
||||
assert text == original
|
||||
|
||||
|
||||
def test_offset_at_emoji():
|
||||
"""
|
||||
Tests that an entity starting at a emoji preserves the emoji.
|
||||
|
@@ -53,6 +53,21 @@ def test_entities_together():
|
||||
assert text == original
|
||||
|
||||
|
||||
def test_nested_entities():
|
||||
"""
|
||||
Test that an entity nested inside another one behaves well.
|
||||
"""
|
||||
original = '**[Example](https://example.com)**'
|
||||
stripped = 'Example'
|
||||
|
||||
text, entities = markdown.parse(original)
|
||||
assert text == stripped
|
||||
assert entities == [MessageEntityBold(0, 7), MessageEntityTextUrl(0, 7, url='https://example.com')]
|
||||
|
||||
text = markdown.unparse(text, entities)
|
||||
assert text == original
|
||||
|
||||
|
||||
def test_offset_at_emoji():
|
||||
"""
|
||||
Tests that an entity starting at a emoji preserves the emoji.
|
||||
|
Reference in New Issue
Block a user