From 07ee7fb2c3495dac114e0028f8e2a8b1ae726add Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Mon, 27 Mar 2017 17:46:11 +0100 Subject: osc: escape ASS and strip newlines on title --- DOCS/man/osc.rst | 1 + player/lua/osc.lua | 2 ++ 2 files changed, 3 insertions(+) diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 17911bbf68..56335229fd 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -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 diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 569bb208ac..ff2d166897 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -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 -- cgit v1.2.3