diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 92706f0c46..1333553040 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -2402,19 +2402,21 @@ void Paragraph::simpleLyXHTMLOnePar(Buffer const & buf, if (style.pass_thru) os.put(c); else if (c == '-') { + docstring str; int j = i + 1; if (j < size() && d->text_[j] == '-') { j += 1; if (j < size() && d->text_[j] == '-') { - os << from_ascii("—"); + str += from_ascii("—"); i += 2; } else { - os << from_ascii("–"); + str += from_ascii("–"); i += 1; } } else - os << c; + str += c; + os << str; } else os << html::escapeChar(c); }