Skip to content

Commit

Permalink
[TASK] Extend image tag attributes
Browse files Browse the repository at this point in the history
Related: #18
  • Loading branch information
ohader committed Aug 13, 2021
1 parent d22b74c commit 7f0af1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Builder/CommonBuilder.php
Expand Up @@ -141,7 +141,7 @@ protected function createMediaTags(): array
->addAttrs(...$this->createAttrs('autoplay', 'controls', 'height', 'loop', 'muted', 'playsinline', 'poster', 'preload', 'width'));
$tags['img'] = (new Behavior\Tag('img', Behavior\Tag::PURGE_WITHOUT_ATTRS))
->addAttrs($this->srcAttr, $this->srcsetAttr, ...$this->globalAttrs)
->addAttrs(...$this->createAttrs('alt', 'decoding', 'height', 'sizes', 'width', 'loading'));
->addAttrs(...$this->createAttrs('align', 'alt', 'border', 'decoding', 'height', 'sizes', 'width', 'loading', 'name'));
$tags['track'] = (new Behavior\Tag('track', Behavior\Tag::PURGE_WITHOUT_ATTRS))
->addAttrs($this->srcAttr, ...$this->globalAttrs)
->addAttrs(...$this->createAttrs('default', 'kind', 'label', 'srcLang'));
Expand Down
4 changes: 2 additions & 2 deletions tests/CommonBuilderTest.php
Expand Up @@ -94,8 +94,8 @@ public function isSanitizedDataProvider(): array
'',
],
'#046' => [
'<img src="/typo3.org/logo.svg" alt="logo" loading="lazy" width="100" height="100" sizes="33.3vw">',
'<img src="/typo3.org/logo.svg" alt="logo" loading="lazy" width="100" height="100" sizes="33.3vw">',
'<img src="/typo3.org/logo.svg" alt="logo" loading="lazy" width="100" height="100" sizes="33.3vw" name="logo" align="left" border="0">',
'<img src="/typo3.org/logo.svg" alt="logo" loading="lazy" width="100" height="100" sizes="33.3vw" name="logo" align="left" border="0">',
],
'#050' => [
'<a href="https://typo3.org/" role="button">value</a>',
Expand Down

0 comments on commit 7f0af1e

Please sign in to comment.