Skip to content

Commit

Permalink
Fix partial percent encoded links in markdown images (thunder-app#1572)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjiangsu authored Oct 7, 2024
1 parent d53b57d commit 0b15d7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/shared/common_markdown_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import 'package:markdown/markdown.dart' as md;
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

import 'package:thunder/shared/text/scalable_text.dart';
import 'package:thunder/utils/colors.dart';

import 'package:thunder/utils/media/image.dart';
import 'package:thunder/utils/links.dart';
import 'package:thunder/shared/image_preview.dart';
Expand Down Expand Up @@ -120,6 +120,8 @@ class CommonMarkdownBody extends StatelessWidget {
imageBuilder: (uri, title, alt) {
if (hideContent) return Container();

String decodedUri = Uri.decodeFull(uri.toString());

return FutureBuilder(
future: isImageUriSvg(uri),
builder: (BuildContext context, AsyncSnapshot<bool> snapshot) {
Expand All @@ -130,7 +132,7 @@ class CommonMarkdownBody extends StatelessWidget {
children: [
snapshot.data != true
? ImagePreview(
url: uri.toString(),
url: decodedUri,
isExpandable: true,
isComment: isComment,
showFullHeightImages: true,
Expand Down

0 comments on commit 0b15d7c

Please sign in to comment.