mastodonapi.php aktualisiert
This commit is contained in:
parent
5b5faa2889
commit
1db48837f6
1 changed files with 12 additions and 17 deletions
|
|
@ -208,15 +208,10 @@ private function generateMarkdown($title, $slug, $dateTime, $html, $origAuthor,
|
|||
$content = html_entity_decode($content, ENT_QUOTES | ENT_HTML5, 'UTF-8');
|
||||
|
||||
$hashtagString = '';
|
||||
// Finde den gesamten Block der Tags am Ende des Strings
|
||||
if (preg_match('/(\s*(#\w+))+$/u', $content, $matches)) {
|
||||
// Entferne den Tag-Block aus dem Content
|
||||
$content = substr($content, 0, -strlen($matches[0]));
|
||||
|
||||
// Finde alle einzelnen Tags im extrahierten Block
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue