mastodonapi.php aktualisiert
This commit is contained in:
parent
6e6c2cf102
commit
99c19422db
1 changed files with 26 additions and 21 deletions
|
|
@ -2,7 +2,7 @@
|
|||
// MastodonAPI extension, https://codeberg.org/simonpipe/yellow-mastodonapi
|
||||
|
||||
class YellowMastodonAPI {
|
||||
const VERSION = "0.5.1";
|
||||
const VERSION = "0.3";
|
||||
public $yellow;
|
||||
|
||||
// Initialisierung
|
||||
|
|
@ -210,13 +210,18 @@ class YellowMastodonAPI {
|
|||
|
||||
$imageMarkdown = '';
|
||||
foreach ($images as $i => $filename) {
|
||||
$alt = isset($alts[$i]) ? $alts[$i] : '';
|
||||
$imageMarkdown .= "\n\n";
|
||||
$alt = isset($alts[$i]) ? htmlspecialchars($alts[$i], ENT_QUOTES) : '';
|
||||
$imageMarkdown .= "\n<img src=\"/media/images/" . $filename . "\" alt=\"" . $alt . "\"/>\n";
|
||||
}
|
||||
|
||||
$featuredImage = '';
|
||||
$featuredImageAlt = '';
|
||||
|
||||
if (!empty($images)) {
|
||||
$featuredImage = "Image: " . $images[0] . "\n";
|
||||
if (isset($alts[0]) && !empty($alts[0])) {
|
||||
$featuredImageAlt = "ImageAlt: " . htmlspecialchars($alts[0], ENT_QUOTES) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$htmlSafeAuthorName = str_replace('@', '@', $origAuthor);
|
||||
|
|
@ -229,7 +234,7 @@ Published: $formattedDate $formattedTime
|
|||
Author: $yellowAuthor
|
||||
Layout: blog
|
||||
Tag: $yellowTag
|
||||
$featuredImage---
|
||||
$featuredImage$featuredImageAlt---
|
||||
$imageMarkdown
|
||||
> "$content"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in a new issue