console: do not strip leading spaces

As suggested by TheAMM and avih.
This commit is contained in:
wm4 2019-12-24 16:04:00 +01:00
parent 029bb593e7
commit 1d2fcb9227
1 changed files with 3 additions and 0 deletions

View File

@ -136,6 +136,9 @@ function ass_escape(str)
-- Precede newlines with a ZWNBSP to prevent ASS's weird collapsing of
-- consecutive newlines
str = str:gsub('\n', '\239\187\191\\N')
-- Turn leading spaces into hard spaces to prevent ASS from stripping them
str = str:gsub('\\N ', '\\N\\h')
str = str:gsub('^ ', '\\h')
return str
end