mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
use single line
This commit is contained in:
parent
026a8fbab6
commit
97c497000a
3 changed files with 7 additions and 18 deletions
|
|
@ -131,27 +131,21 @@ impl Gemini {
|
|||
// Is alt provided
|
||||
let alt = match c.alt {
|
||||
Some(ref alt) => {
|
||||
// Insert alt value to the main buffer
|
||||
buffer.insert_with_tags(
|
||||
&mut buffer.end_iter(),
|
||||
alt.as_str(),
|
||||
&[&tag.title],
|
||||
);
|
||||
|
||||
// Append new line after alt text
|
||||
buffer.insert(&mut buffer.end_iter(), NEW_LINE);
|
||||
|
||||
// Return value as wanted also for syntax highlight detection
|
||||
text_view.add_child_at_anchor(
|
||||
&separator::horizontal(&text_view),
|
||||
&buffer.create_child_anchor(&mut buffer.end_iter()),
|
||||
);
|
||||
buffer.insert(&mut buffer.end_iter(), NEW_LINE);
|
||||
Some(alt)
|
||||
}
|
||||
None => None,
|
||||
};
|
||||
|
||||
text_view.add_child_at_anchor(
|
||||
&separator::horizontal(&text_view),
|
||||
&buffer.create_child_anchor(&mut buffer.end_iter()),
|
||||
);
|
||||
|
||||
// Begin code block construction
|
||||
// Try auto-detect code syntax for given `value` and `alt` @TODO optional
|
||||
match syntax.highlight(&c.value, alt) {
|
||||
|
|
@ -178,11 +172,6 @@ impl Gemini {
|
|||
} // @TODO handle
|
||||
}
|
||||
|
||||
text_view.add_child_at_anchor(
|
||||
&separator::horizontal(&text_view),
|
||||
&buffer.create_child_anchor(&mut buffer.end_iter()),
|
||||
);
|
||||
|
||||
// Reset
|
||||
code = None;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ impl Tag {
|
|||
Self {
|
||||
text_tag: TextTag::builder()
|
||||
.family("monospace") // @TODO
|
||||
//.left_margin(28)
|
||||
.left_margin(28)
|
||||
.scale(0.81) // * the rounded `0.8` value crops text for some reason @TODO
|
||||
.wrap_mode(WrapMode::None)
|
||||
.build(),
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ impl Tag {
|
|||
Self {
|
||||
text_tag: TextTag::builder()
|
||||
.family("monospace") // @TODO
|
||||
//.left_margin(28)
|
||||
.left_margin(28)
|
||||
.scale(0.81) // * the rounded `0.8` value crops text for some reason @TODO
|
||||
.wrap_mode(WrapMode::None)
|
||||
.build(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue