commit 096d75b8fb27f06ea2c99d46d5521297b3dab694
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Sat Mar 15 13:51:10 2025 +0100

    Amend 9ffacb341d
    
    We need to consider DOS line endings (as produced by tex2lyx on Windows),
    otherwise we end up with stray "\r"s which break mathed parsing
---
 src/mathed/InsetMathHull.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 804dcb8bb0..d973b2a512 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -821,7 +821,12 @@ void InsetMathHull::usedMacros(MathData const & md, 
DocIterator const & pos,
                                // with legacy preview and tightpage (#13120).
                                // So remove all preceding and trailing line 
breaks
                                // and re-add one at the end of the snippet
-                               defs.insert(trim(macro_def.str(), "\n") + "\n");
+                               // Convert possible DOS line endings to prevent 
ending
+                               // up with stray "\r"s
+                               defs.insert(trim(subst(macro_def.str(),
+                                                      from_ascii("\r\n"),
+                                                      from_ascii("\n")),
+                                                "\n") + "\n");
                                asArray(data->definition(), ar);
                        }
                        usedMacros(ar, pos, macros, defs);
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to