From f6aa6797d2b9169864ff36a63c5748bdeab958bb Mon Sep 17 00:00:00 2001 From: Michael Schuldes Date: Thu, 6 Mar 2025 08:13:07 +0100 Subject: [PATCH] strip backslashes from comments --- src/betterproto2_compiler/plugin/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/betterproto2_compiler/plugin/models.py b/src/betterproto2_compiler/plugin/models.py index ea385cf1..bc4d75dc 100644 --- a/src/betterproto2_compiler/plugin/models.py +++ b/src/betterproto2_compiler/plugin/models.py @@ -129,11 +129,10 @@ def get_comment( # We don't add this space to the generated file. lines = [line[1:] if line and line[0] == " " else line for line in lines] - return "\n".join(lines) + return "\n".join(lines).replace("\\","\\\\") return "" - @dataclass(kw_only=True) class ProtoContentBase: """Methods common to MessageCompiler, ServiceCompiler and ServiceMethodCompiler."""