Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Introduce mandatory tag attributes #74

Merged
merged 5 commits into from
Oct 6, 2022
Merged

Conversation

ohader
Copy link
Member

@ohader ohader commented Jan 14, 2022

Introduces new Behavior\Attr::MANDATORY flag, declaring an attribute must be given for a particular tag to be valid.

(new Behavior\Tag('script'))
  ->addAttrs(
    (new Behavior\Attr('type', Behavior\Attr::MANDATORY))
      ->addValues(new Behavior\DatasetAttrValue('application/ld+json'))
)

The example above allows <script type="application/ld+json">...</script> but disallows all other occurrences not having type="application/ld+json", thus <script> or <script type="application/javascript"> still would be invalid.

Related: #70, #71

@ohader ohader merged commit 688533f into TYPO3:main Oct 6, 2022
@ohader ohader deleted the issue-70 branch October 6, 2022 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant