From 603cb600aa5ce940fb74620d33109d1913ae1767 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Sun, 25 Aug 2024 10:20:16 +0200 Subject: [PATCH] Fix NormalizedString serialization splitting within escape sequences. Resolves #1589 --- src/registry.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/registry.py b/src/registry.py index 2bc3323da..25ee99881 100644 --- a/src/registry.py +++ b/src/registry.py @@ -737,7 +737,10 @@ class NormalizedString(String): def serialize(self): s = self.__parent.serialize() prefixLen = len(self._name) + 2 - lines = textwrap.wrap(s, width=76-prefixLen) + # break_long_words=False so we don't split in the middle of a + # unicode_escape sequence when there are multiple escape sequences in a + # row. + lines = textwrap.wrap(s, width=76-prefixLen, break_long_words=False) last = len(lines)-1 for (i, line) in enumerate(lines): if i != 0: