mastodonapi.php aktualisiert

This commit is contained in:
simonpipe 2025-08-13 15:15:23 +02:00
parent 5b5faa2889
commit 1db48837f6

View file

@ -208,15 +208,10 @@ private function generateMarkdown($title, $slug, $dateTime, $html, $origAuthor,
$content = html_entity_decode($content, ENT_QUOTES | ENT_HTML5, 'UTF-8'); $content = html_entity_decode($content, ENT_QUOTES | ENT_HTML5, 'UTF-8');
$hashtagString = ''; $hashtagString = '';
// Finde den gesamten Block der Tags am Ende des Strings
if (preg_match('/(\s*(#\w+))+$/u', $content, $matches)) { if (preg_match('/(\s*(#\w+))+$/u', $content, $matches)) {
// Entferne den Tag-Block aus dem Content
$content = substr($content, 0, -strlen($matches[0])); $content = substr($content, 0, -strlen($matches[0]));
// Finde alle einzelnen Tags im extrahierten Block
if (preg_match_all('/#(\w+)/u', $matches[0], $tags)) { if (preg_match_all('/#(\w+)/u', $matches[0], $tags)) {
// Füge die Tags mit einem Leerzeichen zusammen und stelle sicher, dass sie ein # haben $hashtagString = "\n> " . implode(' ', $tags[0]);
$hashtagString = "\n" . implode(' ', $tags[0]);
} }
} }