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

Non-standard video html generated by media.html() #3540

Open
Rotzbua opened this issue Feb 18, 2022 · 1 comment
Open

Non-standard video html generated by media.html() #3540

Rotzbua opened this issue Feb 18, 2022 · 1 comment
Labels

Comments

@Rotzbua
Copy link
Contributor

Rotzbua commented Feb 18, 2022

Grav twig template

{% if media.meta().type == 'video' %}
  {{ media.html() }}
{% endif %}

Output

Current (after 1.7.31):

<video controls="controls" alt=""><source src="test.mp4">Your browser does not support the video tag.</video>

Validator

Used: https://validator.w3.org/nu/

Errors

  • Error: Bad value 1 for attribute controls on element video.
  • Error: Attribute alt not allowed on element video at this point.

Reference

Specification video: https://html.spec.whatwg.org/multipage/media.html#the-video-element

Possible solutions

  • controls="1" replace by controls="controls" or controls
  • alt replace by title or aria-label or aria-describedby

History

  • updated after partial fix in 1.7.31
@mahagr
Copy link
Member

mahagr commented Feb 22, 2022

I didn't find where alt gets generated, but I fixed all the other params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants