]> git.lyx.org Git - features.git/commitdiff
escape spaces in labels
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 6 Nov 2023 13:16:34 +0000 (14:16 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 6 Nov 2023 13:18:03 +0000 (14:18 +0100)
refstyle doesn't work with these. See
https://marc.info/?l=lyx-users&m=169926958114185&w=2

src/support/lstrings.cpp

index d5b6dea588f10e40d378576f0be08270d444f29e..61ea5bf36a97df9f7948ee9dda522464ce3c23bf 100644 (file)
@@ -1230,7 +1230,8 @@ docstring const escape(docstring const & lab)
        for (char_type const c : lab) {
                if (c >= 128 || c == '=' || c == '%' || c == '#' || c == '$'
                    || c == '}' || c == '{' || c == ']' || c == '[' || c == '&'
-                   || c == '\\') {
+                   || c == '\\' || c == ' ') // refstyle doesn't support spaces
+               {
                        // Although char_type is a 32 bit type we know that
                        // UCS4 occupies only 21 bits, so we don't need to
                        // encode bigger values. Test for 2^24 because we