From 1d2fcb9227544e29d261a7256f0774d78fd72e60 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 24 Dec 2019 16:04:00 +0100 Subject: console: do not strip leading spaces As suggested by TheAMM and avih. --- player/lua/console.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/player/lua/console.lua b/player/lua/console.lua index 2444f3359d..01377e86ef 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -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 -- cgit v1.2.3