Fix urls not being accounted for in time placement

Fixes #132.
parent 915d4829
......@@ -17,6 +17,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_html/rich_text_parser.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_html/flutter_html.dart';
......@@ -311,7 +312,10 @@ class _ContentLayoutRenderBox extends RenderBox
if (span.children != null) {
for (final childSpan in span?.children) {
if (childSpan is TextSpan) {
// Needed because of flutter_html
if (childSpan is LinkTextSpan) {
length += childSpan.url?.length ?? 0;
} else if (childSpan is TextSpan) {
length += childSpan.text?.length ?? 0;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment