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

Invalid Markup #24

Closed
designermonkey opened this issue May 4, 2014 · 5 comments
Closed

Invalid Markup #24

designermonkey opened this issue May 4, 2014 · 5 comments

Comments

@designermonkey
Copy link

I really like this little boilerplate, it beats the 'cater for everything' approach of the other larger ones, but I spotted this earlier in the lightbox examples:

<a href="//bbc.co.uk" data-lightbox-title="BBC" 
   data-lightbox-description="<p>sample text or the footer.</p>" 
   data-lightbox-iframe-scroll="true">
    Launch external overlay
</a>

Unfortunately, this is invalid markup for anyone using xhtml5. It won't validate, and any application that uses XML to produce html5 markup would throw a fatal error with this.

Would there be any other way to tackle this?

@JimBobSquarePants
Copy link
Member

Thanks for raising this, I'll do some research and see what I can come up with.

@designermonkey
Copy link
Author

Maybe it could take a function name that outputs markup?

@JimBobSquarePants
Copy link
Member

I did some reading and this is what I discovered:

It turns out there is no such thing as XHTML5. From what I can gather it's been abandoned.
http://programmers.stackexchange.com/a/149843

I was surprised by that.

If you want to create the markup via an XML processor you can HTML encode the value as below:

<a href="//bbc.co.uk" data-lightbox-title="BBC" 
data-lightbox-description="&lt;p&gt;sample text or the footer.&lt;/p&gt;" 
   data-lightbox-iframe-scroll="true">
    Launch external overlay
</a>

That validates as XML according to http://www.xmlvalidation.com/ and jQuery doesn't care which format it is given in since it sanitizes the value to produce HTML anyway.

@designermonkey
Copy link
Author

Thanks for the solution. I am however going to argue for accuracy's sake...

XHTML5 is a synonym for 'HTML5 serialised as XML', and is not dead, for if it was, HTML5 would also be dead.

Yes they dropped support for XHTML, but not the synonym XHTML5.

http://blog.whatwg.org/xhtml5-in-a-nutshell

I would be more inclined to believe that over an answer on an open community question site.

Anyway, all the same, thanks very much for a solution :)

@JimBobSquarePants
Copy link
Member

👍 Nice... Every day is a school day. Happy to help. :)

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

No branches or pull requests

2 participants