Skip to content

Commit a266dbe

Browse files
committed
fix(redis_func_cache): preserve line breaks in clean_lua_script
- Replace "" with "\n" when joining non-empty lines in the Lua script - This change ensures that the cleaned script maintains proper line breaks
1 parent b1f2a59 commit a266dbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/redis_func_cache/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def filter(self, lexer, stream, options):
108108
lexer.add_filter(filter()) # pyright: ignore[reportCallIssue]
109109
code = "".join(tok_str for _, tok_str in lexer.get_tokens(source))
110110
# remote empty lines
111-
return "".join(s for line in code.splitlines() if (s := line.strip()))
111+
return "\n".join(s for line in code.splitlines() if (s := line.strip()))
112112

113113
else:
114114
warn("pygments is not installed, return source code as is", ImportWarning)

0 commit comments

Comments
 (0)