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