revert: Bug fix temporary

pull/1547/head
Ellet 1 year ago
parent c6134b85c1
commit 09d98a54c8
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 18
      lib/src/models/documents/nodes/line.dart

@ -317,13 +317,13 @@ base class Line extends Container<Leaf?> {
void _insertSafe(int index, Object data, Style? style) {
assert(index == 0 || (index > 0 && index < length));
var inlineStyles = style;
if (style != null) {
final nonInlineStyles =
style.attributes.values.where((v) => !v.isInline).toSet();
final styleToApply = style.removeAll(nonInlineStyles);
inlineStyles = styleToApply;
}
// var inlineStyles = style;
// if (style != null) {
// final nonInlineStyles =
// style.attributes.values.where((v) => !v.isInline).toSet();
// final styleToApply = style.removeAll(nonInlineStyles);
// inlineStyles = styleToApply;
// }
if (data is String) {
assert(!data.contains('\n'));
@ -335,10 +335,10 @@ base class Line extends Container<Leaf?> {
if (isEmpty) {
final child = Leaf(data);
add(child);
child.format(inlineStyles);
child.format(style);
} else {
final result = queryChild(index, true);
result.node!.insert(result.offset, data, inlineStyles);
result.node!.insert(result.offset, data, style);
}
}

Loading…
Cancel
Save