From 54eff37ac0e063e52eb2b3bd3e5ae3e4918e0ca8 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Thu, 15 Aug 2024 09:06:14 +0200 Subject: [PATCH] revert_nomencl: escape " and \ for command inset --- lib/lyx2lyx/lyx_2_5.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_5.py b/lib/lyx2lyx/lyx_2_5.py index daaefe63f8..193455227e 100644 --- a/lib/lyx2lyx/lyx_2_5.py +++ b/lib/lyx2lyx/lyx_2_5.py @@ -611,9 +611,15 @@ def revert_nomencl(document): if prefix: newins += ["prefix \"" + lyx2latex(document, prefix) + "\""] if symbol: - newins += ["symbol \"" + lyx2latex(document, symbol) + "\""] + if literal == "true": + newins += ["symbol \"" + lyx2latex(document, symbol).replace("\\", "\\\\").replace("\"", "\\\"") + "\""] + else: + newins += ["symbol \"" + lyx2latex(document, symbol).replace("\"", "\\\"") + "\""] if description: - newins += ["description \"" + lyx2latex(document, description) + "\""] + if literal == "true": + newins += ["description \"" + lyx2latex(document, description).replace("\\", "\\\\").replace("\"", "\\\"") + "\""] + else: + newins += ["description \"" + lyx2latex(document, description).replace("\"", "\\\"") + "\""] newins += ["literal \"" + literal + "\""] j = find_end_of_inset(document.body, i)