</type>
<!-- /trophy list box condition -->
<!-- media -->
+ <type>
+ <name>com.woltlab.wcf.media.caption</name>
+ <definitionname>com.woltlab.wcf.message</definitionname>
+ </type>
<type>
<name>com.woltlab.wcf.media</name>
<definitionname>com.woltlab.wcf.acl.simple</definitionname>
<figure class="articleImage">
<amp-img src="{$articleContent->getImage()->getThumbnailLink('large')}" alt="{$articleContent->getImage()->altText}" height="{@$articleContent->getImage()->getThumbnailHeight('large')}" width="{@$articleContent->getImage()->getThumbnailWidth('large')}" layout="responsive"></amp-img>
{if $articleContent->getImage()->caption}
- <figcaption>{$articleContent->getImage()->caption}</figcaption>
+ <figcaption>
+ {if $articleContent->getImage()->captionEnableHtml}
+ {@$articleContent->getImage()->getAmpCaption()}
+ {else}
+ {$articleContent->getImage()->caption}
+ {/if}
+ </figcaption>
{/if}
</figure>
{/if}
<figure class="articleImage">
<div class="articleImageWrapper">{@$articleContent->getImage()->getThumbnailTag('large')}</div>
{if $articleContent->getImage()->caption}
- <figcaption itemprop="description">{$articleContent->getImage()->caption}</figcaption>
+ <figcaption itemprop="description">
+ {if $articleContent->getImage()->captionEnableHtml}
+ {@$articleContent->getImage()->caption}
+ {else}
+ {$articleContent->getImage()->caption}
+ {/if}
+ </figcaption>
{/if}
</figure>
<meta itemprop="url" content="{$articleContent->getImage()->getThumbnailLink('large')}">
use wcf\data\user\UserProfile;
use wcf\data\DatabaseObjectDecorator;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
+use wcf\system\html\output\AmpHtmlOutputProcessor;
use wcf\util\FileUtil;
use wcf\util\StringUtil;
return $this->userProfile;
}
+ /**
+ * Returns the amp version of the caption.
+ *
+ * @return string
+ * @since 5.2
+ */
+ public function getAmpCaption() {
+ $processor = new AmpHtmlOutputProcessor();
+ $processor->process($this->caption, 'com.woltlab.wcf.media.caption', $this->mediaID);
+
+ return $processor->getHtml();
+ }
+
/**
* Returns the viewable media file with the given id.
*