mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
Fix html_media_regexps (#1710)
* Fix html_media_regexps * Update CONTRIBUTORS
This commit is contained in:
parent
202207b765
commit
b403f20cae
2 changed files with 5 additions and 4 deletions
|
@ -97,6 +97,7 @@ Sam Bradshaw <samjr.bradshaw@gmail.com>
|
|||
gnnoh <gerongfenh@gmail.com>
|
||||
Sachin Govind <sachin.govind.too@gmail.com>
|
||||
Patric Cunha <patricc@agap2.pt>
|
||||
Brayan Oliveira <github.com/BrayanDSO>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -34,13 +34,13 @@ class MediaManager(DeprecatedNamesMixin):
|
|||
sound_regexps = [r"(?i)(\[sound:(?P<fname>[^]]+)\])"]
|
||||
html_media_regexps = [
|
||||
# src element quoted case
|
||||
r"(?i)(<[img|audio][^>]* src=(?P<str>[\"'])(?P<fname>[^>]+?)(?P=str)[^>]*>)",
|
||||
r"(?i)(<(?:img|audio)\b[^>]* src=(?P<str>[\"'])(?P<fname>[^>]+?)(?P=str)[^>]*>)",
|
||||
# unquoted case
|
||||
r"(?i)(<[img|audio][^>]* src=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)",
|
||||
r"(?i)(<(?:img|audio)\b[^>]* src=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)",
|
||||
# src element quoted case
|
||||
r"(?i)(<object[^>]* data=(?P<str>[\"'])(?P<fname>[^>]+?)(?P=str)[^>]*>)",
|
||||
r"(?i)(<object\b[^>]* data=(?P<str>[\"'])(?P<fname>[^>]+?)(?P=str)[^>]*>)",
|
||||
# unquoted case
|
||||
r"(?i)(<object[^>]* data=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)",
|
||||
r"(?i)(<object\b[^>]* data=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)",
|
||||
]
|
||||
regexps = sound_regexps + html_media_regexps
|
||||
|
||||
|
|
Loading…
Reference in a new issue