本文整理汇总了PHP中Parsedown::inlineImage方法的典型用法代码示例。如果您正苦于以下问题:PHP Parsedown::inlineImage方法的具体用法?PHP Parsedown::inlineImage怎么用?PHP Parsedown::inlineImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parsedown
的用法示例。
在下文中一共展示了Parsedown::inlineImage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: inlineImage
/**
* Overload the function to either return nothing (if image image rendering is disable) or return the
* rendered image by calling the Parsedown function
*
* @param string $Excerpt The excerpt of text to be processed as an image
*
* @return array|null|void
*/
protected function inlineImage($Excerpt)
{
if ($this->allowImages) {
return parent::inlineImage($Excerpt);
}
return null;
}
示例2: inlineImage
/**
* Resolve inline images relative URLs to the module's path
*
* @param $Excerpt
* @return array|void
*/
protected function inlineImage($Excerpt)
{
$image = parent::inlineImage($Excerpt);
$path = new \Enrise\Uri($image['element']['attributes']['src']);
if ($path->isRelative()) {
$image['element']['attributes']['src'] = dol_buildpath('/mymodule/' . $path, 1);
}
return $image;
}
示例3: inlineImage
/**
* Overload the function to either return nothing (if image image rendering is disable) or return the
* rendered image by calling the Parsedown function
*
* @param string $Excerpt The excerpt of text to be processed as an image
*
* @return array|null|void
*/
protected function inlineImage($Excerpt)
{
if ($this->allowImages) {
$Image = parent::inlineImage($Excerpt);
if ($this->camo['enabled']) {
$parts = parse_url($Image['element']['attributes']['src']);
if (!isset($parts['host']) || strlen($parts['host']) === 0) {
return null;
}
if (!in_array($parts['host'], $this->camo['whitelisted_domains'])) {
$Image['element']['attributes']['src'] = $this->camo['base_url'] . hash_hmac('sha1', $Image['element']['attributes']['src'], $this->camo['key']) . '/' . bin2hex($Image['element']['attributes']['src']);
}
}
return $Image;
}
return null;
}