Skip to content

Commit 8524888

Browse files
committed
add changelog, fix small bugs, version bump
1 parent c30f417 commit 8524888

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [0.3.0] - 11th Apr 2021
2+
- Update matrix: URI schemes
3+
- Fix small rendering bug with flutter 2
4+
- Update dependencies
5+
16
## [0.2.0] - 10th Jan 2021
27
- Add support for matrix: URI scheme
38
- Add support for `animated` URL parameter of mxc URLs

lib/rich_text_parser.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,12 @@ class HtmlRichTextParser extends StatelessWidget {
632632
else if (parseContext.parentElement is TextSpan ||
633633
parseContext.parentElement is LinkTextSpan) {
634634
String lastString = parseContext.parentElement.text ?? '';
635-
if (!parseContext.parentElement.children.isEmpty &&
636-
parseContext.parentElement.children.last is TextSpan) {
637-
lastString = parseContext.parentElement.children.last.text ?? '';
635+
if (!parseContext.parentElement.children.isEmpty) {
636+
if (parseContext.parentElement.children.last is TextSpan) {
637+
lastString = parseContext.parentElement.children.last.text ?? '';
638+
} else {
639+
lastString = '';
640+
}
638641
}
639642
if (lastString.endsWith(' ') || lastString.endsWith('\n')) {
640643
finalText = finalText.trimLeft();
@@ -892,15 +895,14 @@ class HtmlRichTextParser extends StatelessWidget {
892895
null;
893896
} else {
894897
final match =
895-
RegExp(r"^matrix:(room|group|roomid|user)\/([^\/]+)$")
898+
RegExp(r"^matrix:(r|roomid|u)\/([^\/]+)$")
896899
.firstMatch(urlLower.split('?').first.split('#').first);
897900
isPill = match != null;
898901
if (isPill) {
899902
identifier = {
900-
'room': '#',
901-
'group': '+',
903+
'r': '#',
902904
'roomid': '!',
903-
'user': '@',
905+
'u': '@',
904906
}[match.group(1)] +
905907
match.group(2);
906908
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_matrix_html
22
description: A Flutter widget for rendering static matrix html tags as Flutter widgets. (Will render over 70 different html tags!)
3-
version: 0.2.0
3+
version: 0.3.0
44
homepage: https://github.com/Sorunome/flutter_matrix_html
55

66
environment:

0 commit comments

Comments
 (0)