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

Loading…
Cancel
Save