tildeio / htmlbars

A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes
MIT License
1.61k stars 193 forks source link

closing a <track> element causes compilation to fail #391

Open oliverlangan opened 9 years ago

oliverlangan commented 9 years ago

When using a within a

"Error: Closing tag track (on line 5) did not match last open tag video (on line 3)."

This is unfortunate, because WebKit (Safari and Chrome both) appends the closing tag when getting the .outerHTML from the DOM.

Sample of failing HTML snippet:

<video height="200" width="470" poster="Art/sintel.jpg" crossorigin="anonymous" controls="">
<source src="Art/sintel.mp4" type="video/mp4">
<track src="Art/sintel-captions.vtt" kind="captions" label="Closed Captions" default=""></track>
</video>

(adapted from http://www.jwplayer.com/html5/track/ )

mmun commented 9 years ago

Track is a void element so this behaviour is "expected". We could provide a better error message.

It sounds like a bug if outerHTML behaves that way. Is it relevant, though?

oliverlangan commented 9 years ago

I agree this is a bug in WebKit's outerHTML. Firefox behaves correctly. I just discovered it via HTMLBars. https://bugs.webkit.org/show_bug.cgi?id=147084