Fix formatting (#51)

* Fix formatting

* fix format

* fix clippy error

* bump version
This commit is contained in:
Dominik Kundel 2025-08-08 18:27:00 -07:00 committed by GitHub
parent 8a4645f0f9
commit 72079ca497
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View file

@ -836,12 +836,13 @@ impl Render<Message> for HarmonyEncoding {
// finally content type
if let Some(content_type) = &message.content_type {
// <|constrain|> is a unique case which needs to be tokenized as a special token
if let Some(constrain_marker) = self.mapped_format_token(FormattingToken::ConstrainedFormat) {
if content_type.starts_with(constrain_marker) {
if let Some(constrain_marker) =
self.mapped_format_token(FormattingToken::ConstrainedFormat)
{
if let Some(rest) = content_type.strip_prefix(constrain_marker) {
// Render the space, then the constrain marker as a special token, then the rest as text (if any)
self.render_text_into(" ", into)?;
self.render_formatting_token_into(FormattingToken::ConstrainedFormat, into)?;
let rest = &content_type[constrain_marker.len()..];
if !rest.is_empty() {
self.render_text_into(rest, into)?;
}