]> git.lyx.org Git - features.git/commitdiff
Output -- and --- in XHTML like in LaTeX
authorGeorg Baum <baum@lyx.org>
Sun, 15 Feb 2015 19:17:21 +0000 (20:17 +0100)
committerGeorg Baum <baum@lyx.org>
Sun, 15 Feb 2015 19:17:21 +0000 (20:17 +0100)
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
src/insets/InsetIPA.cpp
src/insets/InsetIPA.h

index e7b2c78564a446497cddfb1d140eeda11d0eff2a..8ee06ea01fc449787805e6e707003fb2a6a22a20 100644 (file)
@@ -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] == '-') {
index 33ede5515fd57b604991d5fe1d6c0a51a04e5cdd..2f756f28bcb55a3383364e6f1539759f1d60991d 100644 (file)
@@ -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) {
index 4688696b991759db73123a3910936305fee08448..f100c663f9e6856af060f7ba8656df4a0c304e91 100644 (file)
@@ -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; }