mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:55:15 +00:00
make markdown alt-text visible by adding to the title attribute
This commit is contained in:
parent
29fcc013a5
commit
f4bab2b172
2 changed files with 8 additions and 1 deletions
|
@ -246,6 +246,12 @@ class Share
|
|||
}
|
||||
|
||||
$bb .= (($special_object) ? $special . "\r\n" . $this->item['body'] : $this->item['body']);
|
||||
if (in_array($this->item['verb'],['Arrive', 'Leave'])
|
||||
&& ($this->item['lat'] || $this->item['lon'])
|
||||
&& !str_contains($bb,'[map=')) {
|
||||
$bb .= "\n\n" . '[map=' . $this->item['lat'] . ',' . $this->item['lon'] . ']' . "\n";
|
||||
}
|
||||
|
||||
$bb .= "[/share]";
|
||||
}
|
||||
|
||||
|
|
|
@ -1343,10 +1343,11 @@ function md_image($content)
|
|||
if (isset($content[2])) {
|
||||
$content[2] = str_replace('"', '', $content[2]);
|
||||
$alt = 'alt="' . filter_var($content[2], FILTER_SANITIZE_STRING) . '"';
|
||||
$title = str_replace('alt=', 'title=', $alt);
|
||||
}
|
||||
|
||||
/** @noinspection HtmlRequiredAltAttribute */
|
||||
return sprintf('<img src="%s" %s>', $url, $alt);
|
||||
return sprintf('<img src="%s" %s %s>', $url, $alt, $title);
|
||||
}
|
||||
|
||||
function md_topheader($matches)
|
||||
|
|
Loading…
Reference in a new issue