use .img class
parent
b6b1597748
commit
835c5f810d
|
@ -145,7 +145,7 @@ lite-youtube {
|
|||
margin: 14px 0 0 0!important;
|
||||
}
|
||||
|
||||
img[alt^="![]("] {
|
||||
img[alt^="![]("], .img {
|
||||
height: 150px;
|
||||
width: 90%;
|
||||
-o-object-fit: contain;
|
||||
|
|
|
@ -7137,7 +7137,7 @@ body {
|
|||
line-height: 2.3;
|
||||
}
|
||||
|
||||
.dm_img[alt^="![]("] {
|
||||
.dm_img {
|
||||
width: 200px;
|
||||
max-height: 100vh !important;
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ bs_trigger(document);
|
|||
document.addEventListener("click", function(e){
|
||||
const element = e.target
|
||||
|
||||
if (element instanceof HTMLImageElement && (element.alt.startsWith('![](')) || element.classList.contains('in-comment-image')) {
|
||||
if (element instanceof HTMLImageElement && (element.alt.startsWith('![](')) || element.classList.contains('in-comment-image') || element.classList.contains('img')) {
|
||||
expandImage()
|
||||
}
|
||||
else if (element.classList.contains('showmore')) {
|
||||
|
|
|
@ -76,6 +76,7 @@ def allowed_attributes(tag, name, value):
|
|||
if name == 'data-bs-toggle' and value == 'tooltip': return True
|
||||
if name in {'g','b','glow'} and not value: return True
|
||||
if name in {'alt','title'}: return True
|
||||
if name == 'class' and value == 'img': return True
|
||||
|
||||
if tag == 'lite-youtube':
|
||||
if name == 'params' and value.startswith('autoplay=1&modestbranding=1'): return True
|
||||
|
@ -415,6 +416,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
|
|||
tag["data-src"] = tag["src"]
|
||||
tag["src"] = "/i/l.webp"
|
||||
tag['alt'] = tag["data-src"]
|
||||
tag['class'] = "img"
|
||||
|
||||
if tag.parent.name != 'a':
|
||||
a = soup.new_tag("a", href=tag["data-src"])
|
||||
|
|
Loading…
Reference in New Issue