- docstring const math = it->second.mathcommand;
- docstring const text = it->second.textcommand;
+ docstring const math = mathmode ? it->second.mathcommand
+ : docstring();
+ docstring const text = textmode ? it->second.textcommand
+ : docstring();
size_t cur_size = max(math.size(), text.size());
// The current math or text unicode command cannot
// match, or we already matched a longer one
size_t cur_size = max(math.size(), text.size());
// The current math or text unicode command cannot
// match, or we already matched a longer one
// We don't use find_if because it makes copies of the pairs in
// the map.
// This linear search is OK since we don't have many encodings.
// We don't use find_if because it makes copies of the pairs in
// the map.
// This linear search is OK since we don't have many encodings.