|
|
|
@ -402,7 +402,7 @@ class Line extends Container<Leaf?> { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Need to add current line's style or parent block's style? |
|
|
|
|
// TODO: add line style and parent's block style |
|
|
|
|
|
|
|
|
|
final remaining = len - local; |
|
|
|
|
if (remaining > 0) { |
|
|
|
@ -452,6 +452,9 @@ class Line extends Container<Leaf?> { |
|
|
|
|
final res = _getPlainText(offset, len); |
|
|
|
|
if (res.length == 1) { |
|
|
|
|
final data = queryChild(offset, true); |
|
|
|
|
if ((data.node as Leaf) is Embed) { |
|
|
|
|
return ''; |
|
|
|
|
} |
|
|
|
|
final text = res.single.item2; |
|
|
|
|
return text.substring(data.offset, data.offset + len); |
|
|
|
|
} |
|
|
|
@ -460,16 +463,22 @@ class Line extends Container<Leaf?> { |
|
|
|
|
// Adjust first node |
|
|
|
|
final firstNodeLen = res[1].item1; |
|
|
|
|
var text = res[0].item2; |
|
|
|
|
total.add(text.substring(text.length - firstNodeLen)); |
|
|
|
|
if (text != Embed.kObjectReplacementCharacter) { |
|
|
|
|
total.add(text.substring(text.length - firstNodeLen)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (var i = 1; i < res.length - 1; i++) { |
|
|
|
|
total.add(res[i].item2); |
|
|
|
|
if (text != Embed.kObjectReplacementCharacter) { |
|
|
|
|
total.add(res[i].item2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Adjust last node |
|
|
|
|
final lastNodeLen = len - res[res.length - 1].item1; |
|
|
|
|
text = res[res.length - 1].item2; |
|
|
|
|
total.add(text.substring(0, lastNodeLen)); |
|
|
|
|
if (text != Embed.kObjectReplacementCharacter) { |
|
|
|
|
total.add(text.substring(0, lastNodeLen)); |
|
|
|
|
} |
|
|
|
|
return total.join(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|