]> git.lyx.org Git - lyx.git/commit
Supplement the fix for bug #11586
authorEnrico Forestieri <forenr@lyx.org>
Sun, 26 May 2019 07:56:34 +0000 (09:56 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 26 May 2019 07:56:34 +0000 (09:56 +0200)
commit15f4fa452d92d0f96a92f84901b2e26ba8d395c8
treee5e5bc3fe36a8913fdb99db8d2d7aa00aac33af3
parentbda3b799c579a1b104bf605a5d5d380b9b5cc949
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