Skip to content

Commit

Permalink
sanitize ASS tags from expand-text
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Jan 22, 2024
1 parent bc0e172 commit 58f2240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/dialog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ mp.register_script_message('open-clipboard', function(action)
mp.commandv('script-message-to', 'menu', 'clipboard/get', mp.get_script_name())
end)

--set clipboard
-- set clipboard
mp.register_script_message('set-clipboard', function(text)
if not text then return end
local res, err = mp.command_native({ 'expand-text', text })
local value = res and res or 'error: ' .. err
local value = res and res:gsub('\xFD.-\xFE', '') or 'error: ' .. err
mp.commandv('script-message-to', 'menu', 'clipboard/set', value)
end)

0 comments on commit 58f2240

Please sign in to comment.