use single line

This commit is contained in:
yggverse 2026-03-23 03:13:00 +02:00
parent 026a8fbab6
commit 97c497000a
3 changed files with 7 additions and 18 deletions

View file

@ -131,27 +131,21 @@ impl Gemini {
// Is alt provided // Is alt provided
let alt = match c.alt { let alt = match c.alt {
Some(ref alt) => { Some(ref alt) => {
// Insert alt value to the main buffer
buffer.insert_with_tags( buffer.insert_with_tags(
&mut buffer.end_iter(), &mut buffer.end_iter(),
alt.as_str(), alt.as_str(),
&[&tag.title], &[&tag.title],
); );
// Append new line after alt text
buffer.insert(&mut buffer.end_iter(), NEW_LINE); buffer.insert(&mut buffer.end_iter(), NEW_LINE);
text_view.add_child_at_anchor(
// Return value as wanted also for syntax highlight detection &separator::horizontal(&text_view),
&buffer.create_child_anchor(&mut buffer.end_iter()),
);
buffer.insert(&mut buffer.end_iter(), NEW_LINE);
Some(alt) Some(alt)
} }
None => None, None => None,
}; };
text_view.add_child_at_anchor(
&separator::horizontal(&text_view),
&buffer.create_child_anchor(&mut buffer.end_iter()),
);
// Begin code block construction // Begin code block construction
// Try auto-detect code syntax for given `value` and `alt` @TODO optional // Try auto-detect code syntax for given `value` and `alt` @TODO optional
match syntax.highlight(&c.value, alt) { match syntax.highlight(&c.value, alt) {
@ -178,11 +172,6 @@ impl Gemini {
} // @TODO handle } // @TODO handle
} }
text_view.add_child_at_anchor(
&separator::horizontal(&text_view),
&buffer.create_child_anchor(&mut buffer.end_iter()),
);
// Reset // Reset
code = None; code = None;
} }

View file

@ -20,7 +20,7 @@ impl Tag {
Self { Self {
text_tag: TextTag::builder() text_tag: TextTag::builder()
.family("monospace") // @TODO .family("monospace") // @TODO
//.left_margin(28) .left_margin(28)
.scale(0.81) // * the rounded `0.8` value crops text for some reason @TODO .scale(0.81) // * the rounded `0.8` value crops text for some reason @TODO
.wrap_mode(WrapMode::None) .wrap_mode(WrapMode::None)
.build(), .build(),

View file

@ -20,7 +20,7 @@ impl Tag {
Self { Self {
text_tag: TextTag::builder() text_tag: TextTag::builder()
.family("monospace") // @TODO .family("monospace") // @TODO
//.left_margin(28) .left_margin(28)
.scale(0.81) // * the rounded `0.8` value crops text for some reason @TODO .scale(0.81) // * the rounded `0.8` value crops text for some reason @TODO
.wrap_mode(WrapMode::None) .wrap_mode(WrapMode::None)
.build(), .build(),