Plyr: Captions with formatting can produce nested spans

Created on 5 Jun 2018  路  6Comments  路  Source: sampotts/plyr

The getCueAsHTML() method converts cue markup to html. For example:

<v John Green>The human tongue is like <i.foreignphrase><lang ja>wasabi</lang></i>: it's very powerful, and should be used sparingly</v>

This will be converted to:

<span title="John Green">The human tongue is like <i class="foreignphrase"><span lang="ja">wasabi</span></i>: it's very powerful, and should be used sparingly</span>

<span> can be added for metadata, but since Plyr uses span for styling the cue directly this causes issues.

screen shot 2018-06-05 at 14 58 16

(Opacity has been increased to better illustrate the issue)

It happens in both Chrome and Firefox (haven't tested it in any other browser).

Bug

All 6 comments

Proposed solution:

Add a more specific selector for captions (or strip the html, but it's perhaps better as an option).

Yeah I think we'd just need to add a > child combinator.

That should work fine too.

An additional selector would be cleaner though I suppose. plyr__caption or something.

I'll fix this after #1000. Already have some other related changes locally.

馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frumbert picture frumbert  路  3Comments

tomByrer picture tomByrer  路  3Comments

muuvmuuv picture muuvmuuv  路  3Comments

ahmadshc picture ahmadshc  路  4Comments

Antonio-Laguna picture Antonio-Laguna  路  3Comments