Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-28 17:46:45 +08:00
parent 3cdd40a710
commit 25995b0ed6
3 changed files with 17 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ Widget htmlRender({
final bool isEmote = imgUrl.contains('/emote/');
final bool isMall = imgUrl.contains('/mall/');
if (isMall) {
return const SizedBox();
return const SizedBox.shrink();
}
// bool inTable =
// extensionContext.element!.previousElementSibling == null ||
@@ -43,6 +43,18 @@ Widget htmlRender({
// width: isEmote ? 22 : null,
// height: isEmote ? 22 : null,
// );
String? height = RegExp(r'max-height:(\d+)px')
.firstMatch('${attributes['style']}')
?.group(1);
if (height != null) {
return NetworkImgLayer(
width: constrainedWidth,
height: double.parse(height),
src: imgUrl,
type: 'emote',
boxFit: BoxFit.contain,
);
}
return Hero(
tag: imgUrl,
child: GestureDetector(