X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetSpecialChar.cpp;h=58df102dde2c4b5692e031249bb81b3dd7e99378;hb=e15d3d35cba7266d8a1a22c7e4cd92d12599e103;hp=1fe6840df59f20cbe69af8a86b51dbf71d2dc84b;hpb=85f486f2594b446012902c8329615f92cd0d6818;p=lyx.git diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp index 1fe6840df5..58df102dde 100644 --- a/src/insets/InsetSpecialChar.cpp +++ b/src/insets/InsetSpecialChar.cpp @@ -239,12 +239,15 @@ void InsetSpecialChar::latex(otexstream & os, } -int InsetSpecialChar::plaintext(odocstream & os, OutputParams const &) const +int InsetSpecialChar::plaintext(odocstringstream & os, + OutputParams const &, size_t) const { switch (kind_) { case HYPHENATION: - case LIGATURE_BREAK: return 0; + case LIGATURE_BREAK: + os.put(0x200c); + return 1; case END_OF_SENTENCE: os << '.'; return 1; @@ -258,7 +261,7 @@ int InsetSpecialChar::plaintext(odocstream & os, OutputParams const &) const os << '/'; return 1; case NOBREAKDASH: - os << '-'; + os.put(0x2011); return 1; } return 0; @@ -295,7 +298,9 @@ docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const { switch (kind_) { case HYPHENATION: + break; case LIGATURE_BREAK: + xs << XHTMLStream::ESCAPE_NONE << "‌"; break; case END_OF_SENTENCE: xs << '.'; @@ -310,7 +315,7 @@ docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const xs << XHTMLStream::ESCAPE_NONE << "⁄"; break; case NOBREAKDASH: - xs << '-'; + xs << XHTMLStream::ESCAPE_NONE << "‑"; break; } return docstring(); @@ -319,11 +324,21 @@ docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const void InsetSpecialChar::toString(odocstream & os) const { - plaintext(os, OutputParams(0)); + switch (kind_) { + case LIGATURE_BREAK: + // Do not output ZERO WIDTH NON JOINER here + // Spell checker would choke on it. + return; + default: + break; + } + odocstringstream ods; + plaintext(ods, OutputParams(0)); + os << ods.str(); } -void InsetSpecialChar::forToc(docstring & os, size_t) const +void InsetSpecialChar::forOutliner(docstring & os, size_t) const { odocstringstream ods; plaintext(ods, OutputParams(0));