mirror of
https://github.com/videojs/video.js.git
synced 2025-01-08 07:00:10 +02:00
fix(menu-item): replace innerHTML of menu item to fix string bug on player
This commit is contained in:
parent
51b4670f69
commit
a43965fd77
@ -74,6 +74,15 @@ class MenuItem extends ClickableComponent {
|
|||||||
textContent: this.localize(this.options_.label)
|
textContent: this.localize(this.options_.label)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const containsHexCode = (s) => {
|
||||||
|
return /\w*(&#x...)\w*/.test(s);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (containsHexCode(menuItemEl.textContent)) {
|
||||||
|
// Replacement that allows innerHTML to be render properly.
|
||||||
|
menuItemEl.innerHTML = menuItemEl.textContent;
|
||||||
|
}
|
||||||
|
|
||||||
// If using SVG icons, the element with vjs-icon-placeholder will be added separately.
|
// If using SVG icons, the element with vjs-icon-placeholder will be added separately.
|
||||||
if (this.player_.options_.experimentalSvgIcons) {
|
if (this.player_.options_.experimentalSvgIcons) {
|
||||||
el.appendChild(menuItemEl);
|
el.appendChild(menuItemEl);
|
||||||
|
Loading…
Reference in New Issue
Block a user