Fix html_media_regexps (#1710)

* Fix html_media_regexps

* Update CONTRIBUTORS
This commit is contained in:
Brayan Oliveira 2022-03-06 22:02:30 -03:00 committed by GitHub
parent 202207b765
commit b403f20cae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -97,6 +97,7 @@ Sam Bradshaw <samjr.bradshaw@gmail.com>
gnnoh <gerongfenh@gmail.com> gnnoh <gerongfenh@gmail.com>
Sachin Govind <sachin.govind.too@gmail.com> Sachin Govind <sachin.govind.too@gmail.com>
Patric Cunha <patricc@agap2.pt> Patric Cunha <patricc@agap2.pt>
Brayan Oliveira <github.com/BrayanDSO>
******************** ********************

View file

@ -34,13 +34,13 @@ class MediaManager(DeprecatedNamesMixin):
sound_regexps = [r"(?i)(\[sound:(?P<fname>[^]]+)\])"] sound_regexps = [r"(?i)(\[sound:(?P<fname>[^]]+)\])"]
html_media_regexps = [ html_media_regexps = [
# src element quoted case # 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 # unquoted case
r"(?i)(<[img|audio][^>]* src=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)", r"(?i)(<(?:img|audio)\b[^>]* src=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)",
# src element quoted case # 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 # unquoted case
r"(?i)(<object[^>]* data=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)", r"(?i)(<object\b[^>]* data=(?!['\"])(?P<fname>[^ >]+)[^>]*?>)",
] ]
regexps = sound_regexps + html_media_regexps regexps = sound_regexps + html_media_regexps