tools/import_article: add align=center to images
This commit is contained in:
parent
863da9ba08
commit
50d299e38b
@ -218,13 +218,13 @@ class Upload extends model {
|
|||||||
return sizeString($this->size);
|
return sizeString($this->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMarkdown(): string {
|
function getMarkdown(?string $options = null): string {
|
||||||
if ($this->isImage()) {
|
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()) {
|
} else if ($this->isVideo()) {
|
||||||
$md = '{video:'.$this->randomId.'}{/video}';
|
$md = '{video:'.$this->randomId.($options ? ','.$options : '').'}{/video}';
|
||||||
} else {
|
} else {
|
||||||
$md = '{fileAttach:'.$this->randomId.'}{/fileAttach}';
|
$md = '{fileAttach:'.$this->randomId.($options ? ','.$options : '').'}{/fileAttach}';
|
||||||
}
|
}
|
||||||
$md .= ' <!-- '.$this->name.' -->';
|
$md .= ' <!-- '.$this->name.' -->';
|
||||||
return $md;
|
return $md;
|
||||||
|
@ -86,7 +86,7 @@ function processImages($md) {
|
|||||||
logDebug('found existing upload with source_url='.$clean_url);
|
logDebug('found existing upload with source_url='.$clean_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $upload->getMarkdown();
|
return $upload->getMarkdown('align=center');
|
||||||
},
|
},
|
||||||
$md
|
$md
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user