mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
cover plain text into the tag
This commit is contained in:
parent
0d9fc801c9
commit
22ad9dd666
1 changed files with 6 additions and 2 deletions
|
|
@ -114,8 +114,12 @@ impl Reader {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Nothing match tags, use plain text @TODO
|
||||
buffer.insert(&mut buffer.end_iter(), line);
|
||||
// Nothing match custom tags above,
|
||||
// just append plain text covered in empty tag (to handle controller events properly)
|
||||
let tag = TextTag::builder().wrap_mode(WrapMode::Word).build();
|
||||
|
||||
buffer.tag_table().add(&tag);
|
||||
buffer.insert_with_tags(&mut buffer.end_iter(), &line, &[&tag]);
|
||||
buffer.insert(&mut buffer.end_iter(), "\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue