mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 08:35:28 +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
|
// 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);
|
||||||
|
|
||||||
// Return value as wanted also for syntax highlight detection
|
|
||||||
Some(alt)
|
|
||||||
}
|
|
||||||
None => None,
|
|
||||||
};
|
|
||||||
|
|
||||||
text_view.add_child_at_anchor(
|
text_view.add_child_at_anchor(
|
||||||
&separator::horizontal(&text_view),
|
&separator::horizontal(&text_view),
|
||||||
&buffer.create_child_anchor(&mut buffer.end_iter()),
|
&buffer.create_child_anchor(&mut buffer.end_iter()),
|
||||||
);
|
);
|
||||||
|
buffer.insert(&mut buffer.end_iter(), NEW_LINE);
|
||||||
|
Some(alt)
|
||||||
|
}
|
||||||
|
None => None,
|
||||||
|
};
|
||||||
// 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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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(),
|
||||||
|
|
|
||||||
|
|
@ -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(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue