diff options
Diffstat (limited to 'text')
-rw-r--r-- | text/ahead/src/textahead/imp.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/text/ahead/src/textahead/imp.rs b/text/ahead/src/textahead/imp.rs index 7c6a64f15..1ecf4d3f7 100644 --- a/text/ahead/src/textahead/imp.rs +++ b/text/ahead/src/textahead/imp.rs @@ -344,10 +344,14 @@ impl TextAhead { if settings.ahead_attributes.is_empty() { text.push_str(&input.text); } else { - text.push_str(&format!( + use std::fmt::Write; + + write!( + &mut text, "<span {}>{}</span>", - settings.ahead_attributes, input.text - )); + settings.ahead_attributes, input.text, + ) + .unwrap(); } } |