]> git.lyx.org Git - features.git/commit
Supplement the fix for bug #11586
authorEnrico Forestieri <forenr@lyx.org>
Sun, 26 May 2019 07:56:34 +0000 (09:56 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:30 +0000 (15:48 +0200)
commit11c96f913f2168de1ffc52f9351965324b69cbe6
treeb8b5d04bf196874795f27d0b63aa32548d0ad921
parentccd19517b2ec91521c830052701388e9faae0718
Supplement the fix for bug #11586

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