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.
This commit is contained in:
Georg Baum 2015-02-15 20:17:21 +01:00
parent eaaeda65cb
commit e4ec11e8a1
3 changed files with 12 additions and 1 deletions

View File

@ -3162,7 +3162,8 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
if (style.pass_thru || runparams.pass_thru) if (style.pass_thru || runparams.pass_thru)
xs << c; xs << c;
else if (c == '-') { else if (c == '-' && !runparams.inIPA &&
font.fontInfo().family() != TYPEWRITER_FAMILY) {
docstring str; docstring str;
int j = i + 1; int j = i + 1;
if (j < size() && d->text_[j] == '-') { if (j < size() && d->text_[j] == '-') {

View 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 bool InsetIPA::insetAllowed(InsetCode code) const
{ {
switch (code) { switch (code) {

View File

@ -72,6 +72,8 @@ public:
/// ///
void latex(otexstream &, OutputParams const &) const; void latex(otexstream &, OutputParams const &) const;
/// ///
docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
///
void validate(LaTeXFeatures & features) const; void validate(LaTeXFeatures & features) const;
/// ///
bool allowSpellCheck() const { return false; } bool allowSpellCheck() const { return false; }