Fix escape issue with some non-alphanumeric characters in chat
This commit is contained in:
parent
1c6e35f58a
commit
546901a55b
@ -357,6 +357,7 @@ function handle_enter()
|
|||||||
if line == '' then
|
if line == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
line = string.gsub(line,"\\", "\\\\")
|
||||||
line = string.gsub(line,"\"", "\\\"")
|
line = string.gsub(line,"\"", "\\\"")
|
||||||
mp.command('print-text "<chat>'..line..'</chat>"')
|
mp.command('print-text "<chat>'..line..'</chat>"')
|
||||||
clear()
|
clear()
|
||||||
|
|||||||
@ -96,7 +96,6 @@ class MplayerPlayer(BasePlayer):
|
|||||||
username = self._sanitizeText(username)
|
username = self._sanitizeText(username)
|
||||||
message = self._sanitizeText(message)
|
message = self._sanitizeText(message)
|
||||||
messageString = u"<{}> {}".format(username, message)
|
messageString = u"<{}> {}".format(username, message)
|
||||||
messageString = self._sanitizeText(messageString)
|
|
||||||
self._listener.sendLine(u'script-message-to syncplayintf chat "{}"'.format(messageString))
|
self._listener.sendLine(u'script-message-to syncplayintf chat "{}"'.format(messageString))
|
||||||
|
|
||||||
def setSpeed(self, value):
|
def setSpeed(self, value):
|
||||||
@ -143,7 +142,8 @@ class MplayerPlayer(BasePlayer):
|
|||||||
text = text.replace("\n", "")
|
text = text.replace("\n", "")
|
||||||
text = text.replace("\\\"", "<SYNCPLAY_QUOTE>")
|
text = text.replace("\\\"", "<SYNCPLAY_QUOTE>")
|
||||||
text = text.replace("\"", "<SYNCPLAY_QUOTE>")
|
text = text.replace("\"", "<SYNCPLAY_QUOTE>")
|
||||||
text = text.replace("\\", u"\\\\\\uFEFF")
|
text = text.replace("%", "%%")
|
||||||
|
text = text.replace("\\", "\\\\")
|
||||||
text = text.replace("{", "\\\\{")
|
text = text.replace("{", "\\\\{")
|
||||||
text = text.replace("}", "\\\\}")
|
text = text.replace("}", "\\\\}")
|
||||||
text = text.replace("}", "\\\\}")
|
text = text.replace("}", "\\\\}")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user