From e4ec11e8a15d59e6b8687ea592d0b474fff0693a Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 15 Feb 2015 20:17:21 +0100 Subject: [PATCH] Output -- and --- in XHTML like in LaTeX For exports based on LaTeX, consecutive hyphens are only converted to endash and emdash if the current font family is not typewriter, and if none of the parent insets is an IPA inset. Now this is done for XHTML export as well. --- src/Paragraph.cpp | 3 ++- src/insets/InsetIPA.cpp | 8 ++++++++ src/insets/InsetIPA.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index e7b2c78564..8ee06ea01f 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -3162,7 +3162,8 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf, if (style.pass_thru || runparams.pass_thru) xs << c; - else if (c == '-') { + else if (c == '-' && !runparams.inIPA && + font.fontInfo().family() != TYPEWRITER_FAMILY) { docstring str; int j = i + 1; if (j < size() && d->text_[j] == '-') { diff --git a/src/insets/InsetIPA.cpp b/src/insets/InsetIPA.cpp index 33ede5515f..2f756f28bc 100644 --- a/src/insets/InsetIPA.cpp +++ b/src/insets/InsetIPA.cpp @@ -231,6 +231,14 @@ void InsetIPA::latex(otexstream & os, OutputParams const & runparams_in) const } +docstring InsetIPA::xhtml(XHTMLStream & xs, OutputParams const & runparams_in) const +{ + OutputParams runparams(runparams_in); + runparams.inIPA = true; + return InsetText::xhtml(xs, runparams); +} + + bool InsetIPA::insetAllowed(InsetCode code) const { switch (code) { diff --git a/src/insets/InsetIPA.h b/src/insets/InsetIPA.h index 4688696b99..f100c663f9 100644 --- a/src/insets/InsetIPA.h +++ b/src/insets/InsetIPA.h @@ -72,6 +72,8 @@ public: /// void latex(otexstream &, OutputParams const &) const; /// + docstring xhtml(XHTMLStream & xs, OutputParams const &) const; + /// void validate(LaTeXFeatures & features) const; /// bool allowSpellCheck() const { return false; } -- 2.39.2