fix: support spaced emoji media attributes

This commit is contained in:
liuwei
2026-04-13 12:21:06 +08:00
parent 45d97b2989
commit 7ee5ba93ab
6 changed files with 14 additions and 9 deletions

View File

@@ -36,7 +36,11 @@ def _is_usable_local_media_path(value: str) -> bool:
def _extract_emoji_preview_url(xml_text: str) -> str:
if not xml_text:
return ''
patterns = (r'cdnurl="([^"]+)"', r'encrypturl="([^"]+)"', r'externurl="([^"]+)"')
patterns = (
r'cdnurl\s*=\s*"([^"]+)"',
r'encrypturl\s*=\s*"([^"]+)"',
r'externurl\s*=\s*"([^"]+)"'
)
for pattern in patterns:
match = re.search(pattern, xml_text)
if match: