last things, webp images all aboard

This commit is contained in:
noxy
2019-09-02 22:06:28 +00:00
parent 4b6d5812a8
commit 08d88a0c9c
13 changed files with 36 additions and 16 deletions

View File

@@ -42,10 +42,10 @@ class Markdown extends \Parsedown {
if (preg_match('/\:(\w+)\:/mUs', $Excerpt['text'], $matches)) {
$path = "images/comments/" . $matches[1];
$file_ext = "";
if(file_exists($path . ".png"))
$file_ext = ".png";
else if(file_exists($path . ".gif"))
$file_ext = ".gif";
if(file_exists($path . ".webp"))
$file_ext = ".webp";
else if(file_exists($path . ".webp"))
$file_ext = ".webp";
if($file_ext === "")
return;
return [
@@ -55,7 +55,7 @@ class Markdown extends \Parsedown {
'handler' => 'line',
'attributes' => [
'class' => 'comment_emoji',
'src' => '//s.w0bm.com/images/comments/' . $matches[1] . $file_ext,
'src' => '//w0bm.com/images/comments/' . $matches[1] . $file_ext,
'alt' => ':' . $matches[1] . ':',
'title' => ':' . $matches[1] . ':'
],