{
switch (params_.kind) {
case InsetSpaceParams::NORMAL:
- os << (runparams.free_spacing && (runparams.for_search == OutputParams::NoSearch) ? " " : "\\ ");
+ if (runparams.for_search != OutputParams::NoSearch)
+ os << "~";
+ else
+ os << (runparams.free_spacing ? " " : "\\ ");
break;
case InsetSpaceParams::PROTECTED:
if (runparams.local_font &&
blanks++;
i++;
}
- else if (tempx[i] == '\\' && tempx[i+1] == '\\' && tempx[i+2] == ' ') {
- blanks++;
- i += 2;
- }
else {
if (blanks > 0) {
temp += "\\s+";
if (lng != str.size()) {
str = str.substr(0, lng);
}
+ // Replace occurences of '~' to ' '
+ static std::regex specialChars { R"(~)" };
+ str = std::regex_replace(str, specialChars, R"( )" );
}
if (str.empty()) {
mres.match_len = -1;
while (mres.match_len > 0) {
QChar c = qstr.at(matchend - 1);
if ((c == '\n') || (c == '}') || (c == '{')) {
- mres.match_len--;
+ // mres.match_len--;
matchend--;
}
else
while (mres.match_len > 0) {
char c = str.at(matchend - 1);
if ((c == '\n') || (c == '}') || (c == '{')) {
- mres.match_len--;
+ // mres.match_len--;
matchend--;
}
else