]> git.lyx.org Git - features.git/commitdiff
Encoding::fromLaTeXCommand: properly record requirements when exiting early
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 2 Mar 2022 11:48:10 +0000 (12:48 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 2 Mar 2022 11:48:10 +0000 (12:48 +0100)
src/Encoding.cpp

index a4c706bd3b409b30a68e46ef4b3ca3f96fe2630e..d0610efb2e2af646dd60f2355dab5d65744bfa42 100644 (file)
@@ -390,6 +390,9 @@ docstring Encodings::fromLaTeXCommand(docstring const & cmd, int cmdtype,
                                        docstring value;
                                        value += unicodeSymbol.first;
                                        needsTermination = !unicodeSymbol.second.mathNoTermination();
+                                       if (req && unicodeSymbol.second.mathFeature()
+                                               && !unicodeSymbol.second.mathPreamble().empty())
+                                                       req->insert(unicodeSymbol.second.mathPreamble());
                                        return value;
                                }
                        }
@@ -400,6 +403,9 @@ docstring Encodings::fromLaTeXCommand(docstring const & cmd, int cmdtype,
                                        docstring value;
                                        value += unicodeSymbol.first;
                                        needsTermination = !unicodeSymbol.second.textNoTermination();
+                                       if (req && unicodeSymbol.second.textFeature()
+                                               && !unicodeSymbol.second.textPreamble().empty())
+                                               req->insert(unicodeSymbol.second.textPreamble());
                                        return value;
                                }
                        }