Skip to content

Commit d886535

Browse files
committed
Join multiple consecutive line breaks
1 parent 215b750 commit d886535

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/autorun/sh_custom_chat.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ function CustomChat.CleanupString( str )
162162
str = str:gsub( code, replacement )
163163
end
164164

165+
-- join multiple, consecutive line breaks
166+
str = str:gsub( "\n\n+", "\n" )
167+
165168
-- limit the number of line breaks
166169
local max = CustomChat.GetConVarInt( "max_lines", 5 )
167170
local breaks = 0

0 commit comments

Comments
 (0)