summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0cde3dc)
This is important for commands like !`, that are equivalent to \textexclamdown. However, ! is matched earlier, because the logic works with prefixes, hence the output doesn't make sense.
See https://www.lyx.org/ for more information -->
<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
<title>ERT Conversions</title>
See https://www.lyx.org/ for more information -->
<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
<title>ERT Conversions</title>
-<para>These should be <code>&#192;</code>: À À À </para>
+<para>These should be <code>&#192;</code>: À À À</para>
+<para>This one should be <code>&#161;</code>: ¡ ¡</para>
</article>
\ No newline at end of file
</article>
\ No newline at end of file
rem = empty_docstring();
bool const mathmode = cmdtype & MATH_CMD;
bool const textmode = cmdtype & TEXT_CMD;
rem = empty_docstring();
bool const mathmode = cmdtype & MATH_CMD;
bool const textmode = cmdtype & TEXT_CMD;
+
+ // Easy case: the command is a complete entry of unicodesymbols.
+ for (const auto & unicodeSymbol : unicodesymbols) {
+ if (mathmode) {
+ for (const auto & command : unicodeSymbol.second.mathCommands()) {
+ if (command == cmd) {
+ docstring value;
+ value += unicodeSymbol.first;
+ return value;
+ }
+ }
+ }
+ if (textmode) {
+ for (const auto & command : unicodeSymbol.second.textCommands()) {
+ if (command == cmd) {
+ docstring value;
+ value += unicodeSymbol.first;
+ return value;
+ }
+ }
+ }
+ }
+
+ // Otherwise, try to map as many commands as possible, matching prefixes of the command.
docstring symbols;
size_t const cmdend = cmd.size();
size_t prefix = 0;
docstring symbols;
size_t const cmdend = cmd.size();
size_t prefix = 0;