1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 09:02:38 +00:00

osc: escape ASS and strip newlines on title

This commit is contained in:
Ricardo Constantino 2017-03-27 17:46:11 +01:00
parent dc00ad537f
commit 07ee7fb2c3
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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