Skip to content

Commit

Permalink
Added support for custom emojis in spoiler texts.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauryCarrade committed Apr 22, 2019
1 parent 385d5d4 commit b6bd1ee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions shortcodes/MastodonShortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ protected function getData($url)
'<img src="' . $this->fetchImage($emoji['url']) . '" alt="' . $emoji['shortcode'] . '" class="sse-mastodon-custom-emoji" />',
$toot['content']
);

if (isset($toot['spoiler_text']))
{
$toot['spoiler_text'] = str_replace(
':' . $emoji['shortcode'] . ':',
'<img src="' . $this->fetchImage($emoji['url']) . '" alt="' . $emoji['shortcode'] . '" class="sse-mastodon-custom-emoji" />',
$toot['spoiler_text']
);
}
}
}

Expand Down

0 comments on commit b6bd1ee

Please sign in to comment.