fix regex for find images
This commit is contained in:
parent
19b9e636c1
commit
210070b7cf
|
|
@ -189,7 +189,7 @@ def section_name_into_index_name(section_name: str):
|
|||
|
||||
def get_url_images_in_text(text):
|
||||
"""Find images urls in text"""
|
||||
return re.findall(r'(?:http:|https:)?//.*\.(?:png|jpg|svg)', text)
|
||||
return re.findall(r'[^"\'=\s]+\.(jpe?g|png|gif|svg)', text)
|
||||
|
||||
|
||||
def get_image_meta_by_url(url) -> (int, int, int):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user