Skip to content

Commit

Permalink
[TASK] Allow figure tag and necessary attributes in source tag
Browse files Browse the repository at this point in the history
Relates: #18
  • Loading branch information
kevin-appelt authored and ohader committed Aug 12, 2021
1 parent f6c1de1 commit 01f3dee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Builder/CommonBuilder.php
Expand Up @@ -91,7 +91,7 @@ protected function createBasicTags(): array
'address', 'article', 'aside', 'footer', 'header',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'main', 'nav', 'section',
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element#text_content
'blockquote', 'dd', 'div', 'dl', 'dt', 'figcaption', 'li', 'ol', 'p', 'pre', 'ul',
'blockquote', 'dd', 'div', 'dl', 'dt', 'figcaption', 'figure', 'li', 'ol', 'p', 'pre', 'ul',
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element#inline_text_semantics
'a', 'abbr', 'b', 'bdi', 'bdo', 'cite', 'code', 'data', 'dfn', 'em', 'i', 'kbd', 'mark',
'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'small', 'span', 'strong', 'sub', 'sup',
Expand Down Expand Up @@ -147,7 +147,10 @@ protected function createMediaTags(): array
->addAttrs(...$this->createAttrs('default', 'kind', 'label', 'srcLang'));
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element#embedded_content
$tags['picture'] = (new Behavior\Tag('picture', Behavior\Tag::ALLOW_CHILDREN))->addAttrs(...$this->globalAttrs);
$tags['source'] = (new Behavior\Tag('source'))->addAttrs(...$this->globalAttrs);
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source
$tags['source'] = (new Behavior\Tag('source'))
->addAttrs(...$this->globalAttrs)
->addAttrs(...$this->createAttrs('media', 'sizes', 'src', 'srcset', 'type'));
return $tags;
}

Expand Down

0 comments on commit 01f3dee

Please sign in to comment.