diff --git a/lib/uploads.php b/lib/uploads.php index 1743d01..d698b4b 100644 --- a/lib/uploads.php +++ b/lib/uploads.php @@ -218,13 +218,13 @@ class Upload extends model { return sizeString($this->size); } - function getMarkdown(): string { + function getMarkdown(?string $options = null): string { if ($this->isImage()) { - $md = '{image:'.$this->randomId.',w='.$this->imageW.',h='.$this->imageH.'}{/image}'; + $md = '{image:'.$this->randomId.',w='.$this->imageW.',h='.$this->imageH.($options ? ','.$options : '').'}{/image}'; } else if ($this->isVideo()) { - $md = '{video:'.$this->randomId.'}{/video}'; + $md = '{video:'.$this->randomId.($options ? ','.$options : '').'}{/video}'; } else { - $md = '{fileAttach:'.$this->randomId.'}{/fileAttach}'; + $md = '{fileAttach:'.$this->randomId.($options ? ','.$options : '').'}{/fileAttach}'; } $md .= ' '; return $md; diff --git a/tools/import_article.php b/tools/import_article.php index c8ba930..f3a17d6 100755 --- a/tools/import_article.php +++ b/tools/import_article.php @@ -86,7 +86,7 @@ function processImages($md) { logDebug('found existing upload with source_url='.$clean_url); } - return $upload->getMarkdown(); + return $upload->getMarkdown('align=center'); }, $md );