dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
24.11k stars 3.31k forks source link

Figure - HTML Validation Errors... #1718

Open joshstoth opened 3 years ago

joshstoth commented 3 years ago

Using the https://validator.w3.org/ service. I have found that a figure is not allowed to contain certain elements like 'a' and 'div' even though in the documents here: https://photoswipe.com/documentation/getting-started.html ... With the heading: 'How to build an array of slides from a list of links' It demonstrates this usage...

I've tried to update the wrapper < figure > element to be a div but doing so causes the Gallery view to no longer work... Im using the Photoswipe plugin from NPM and also a .js file with the javascript code below the heading "Here is pure Vanilla JS implementation with IE8 support:" on that same page link above. Any help on getting this to work without the < figure > element would be great. Thank you.

Josh.

An example of one of the gallery items as follows:

`

apriljunge commented 3 years ago

Hey @joshstoth. Can you please verify that the W3 Validator is marked to validate HTML5? As documented on MDN a and div are actually allowed in figure elements. Also in the offical HTML 5 spec states that flow elemnts are allowed inside figure. List of flow elements.