]> git.lyx.org Git - features.git/commit
Fix bug #11586
authorEnrico Forestieri <forenr@lyx.org>
Tue, 25 Jun 2019 20:23:51 +0000 (22:23 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 25 Jun 2019 20:23:51 +0000 (22:23 +0200)
commita2d181905a95b3bb983dac60f3d9603413a01f34
treeefc3a88e8373220844df7ab96f2aca3bc53a8d46
parentf5510a8a8db4c0b09cb220d0e884f66d78e2ba9c
Fix bug #11586

Do not replace a latex command with the corresponding symbol
in the unicodesymbols file unless it can be encoded in the
document encoding.

The mhchem \ce inset is a text mode environment but allows entering
spaces and mathmode commands. However, even if it doesn't allow unicode
symbols, LyX allows entering them (by copy/paste, for example), causing
latex errors. As a unicode symbol may have a proper latex representation
from the unicodesymbols file, use it instead of the bare symbol. Here, we
don't care about the mode because both text and math mode should be allowed.
For example, the ⟶ symbol is not recognized but its latex representation
(\longrightarrow) is fine. Of course, there may be symbols that are
not recognized anyway, but this is better because they cause explicit
errors from mhchem instead of cryptic iconv errors in case they cannot
be represented in the document encoding.
src/mathed/MathExtern.cpp
src/mathed/MathParser.cpp
status.23x