make markdown alt-text visible by adding to the title attribute

This commit is contained in:
Mike Macgirvin 2023-12-19 12:27:25 +11:00
parent 29fcc013a5
commit f4bab2b172
2 changed files with 8 additions and 1 deletions

View file

@ -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]";
}

View file

@ -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)