mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
set link uri as the alt on empty
This commit is contained in:
parent
bb7afaabce
commit
aee744961a
1 changed files with 10 additions and 5 deletions
|
|
@ -29,7 +29,7 @@ impl Link {
|
||||||
|
|
||||||
// Parse line
|
// Parse line
|
||||||
let parsed = Regex::split_simple(
|
let parsed = Regex::split_simple(
|
||||||
r"^=>\s*([^\s]+)\s+(\d{4}-\d{2}-\d{2})?\s*(.+)?$",
|
r"^=>\s*([^\s]+)\s*(\d{4}-\d{2}-\d{2})?\s*(.+)?$",
|
||||||
line,
|
line,
|
||||||
RegexCompileFlags::DEFAULT,
|
RegexCompileFlags::DEFAULT,
|
||||||
RegexMatchFlags::DEFAULT,
|
RegexMatchFlags::DEFAULT,
|
||||||
|
|
@ -77,10 +77,15 @@ impl Link {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Alt
|
// Alt
|
||||||
if let Some(this) = parsed.get(3) {
|
match parsed.get(3) {
|
||||||
alt = Some(GString::from(this.to_string()));
|
// Not empty
|
||||||
name.push(this.to_string());
|
Some(this) => {
|
||||||
}
|
alt = Some(GString::from(this.to_string()));
|
||||||
|
name.push(this.to_string());
|
||||||
|
}
|
||||||
|
// Empty, use resolved address
|
||||||
|
None => name.push(link.to_string()),
|
||||||
|
};
|
||||||
|
|
||||||
// Markup
|
// Markup
|
||||||
markup = gformat!(
|
markup = gformat!(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue