Skip to content

Commit 62e97c8

Browse files
committed
select.lua: put track name in directional isolate
Prevents RTL track names from messing up the subtitle select menu where the name is preceded only by neutral characters.
1 parent 5f9e1bc commit 62e97c8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

player/lua/select.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ end
128128

129129
local function format_track(track)
130130
local bitrate = track["demux-bitrate"] or track["hls-bitrate"]
131+
local bidi_fsi = "\226\129\168" -- U+2068 FIRST STRONG ISOLATE
132+
local bidi_pdi = "\226\129\169" -- U+2069 POP DIRECTIONAL ISOLATE
131133

132134
return (track.selected and "" or "") ..
133-
(track.title and " " .. track.title or "") ..
135+
(track.title and " " .. bidi_fsi .. track.title .. bidi_pdi or "") ..
134136
" (" .. (
135137
(track.lang and track.lang .. " " or "") ..
136138
(track.codec and track.codec .. " " or "") ..

0 commit comments

Comments
 (0)