mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 00:42:57 +00:00
osc: escape ASS and strip newlines on title
This commit is contained in:
parent
dc00ad537f
commit
07ee7fb2c3
@ -244,6 +244,7 @@ Configurable Options
|
||||
|
||||
String that supports property expansion that will be displayed as
|
||||
OSC title.
|
||||
ASS tags are escaped, and newlines and trailing slashes are stripped.
|
||||
|
||||
``tooltipborder``
|
||||
Default: 1
|
||||
|
@ -1514,6 +1514,8 @@ function osc_init()
|
||||
|
||||
ne.content = function ()
|
||||
local title = mp.command_native({"expand-text", user_opts.title})
|
||||
-- escape ASS, and strip newlines and trailing slashes
|
||||
title = title:gsub("\\n", " "):gsub("\\$", ""):gsub("{","\\{")
|
||||
return not (title == "") and title or "mpv"
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user