From 2e764c2c666560e0682464a3229610da06fa8507 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 24 Dec 2012 12:03:44 -0500 Subject: [PATCH] Respect InsetLayout's PassThru setting in XHTML export. --- src/Paragraph.cpp | 2 +- src/insets/InsetText.cpp | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 5095026a92..6d4433f113 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -2890,7 +2890,7 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf, } else { char_type c = getUChar(buf.params(), i); - if (style.pass_thru) + if (style.pass_thru || runparams.pass_thru) xs << c; else if (c == '-') { docstring str; diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 181a79c479..55543ab0d7 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -580,6 +580,7 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & rp, InsetLayout const & il = getLayout(); if (opts & WriteOuterTag) xs << html::StartTag(il.htmltag(), il.htmlattr()); + if ((opts & WriteLabel) && !il.counter().empty()) { BufferParams const & bp = buffer().masterBuffer()->params(); Counters & cntrs = bp.documentClass().counters(); @@ -599,14 +600,21 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & rp, if (opts & WriteInnerTag) xs << html::StartTag(il.htmlinnertag(), il.htmlinnerattr()); - OutputParams ours = runparams; + + // we will eventaully lose information about the containing inset if (!il.isMultiPar() || opts == JustText) - ours.html_make_pars = false; - xhtmlParagraphs(text_, buffer(), xs, ours); + runparams.html_make_pars = false; + if (il.isPassThru()) + runparams.pass_thru = true; + + xhtmlParagraphs(text_, buffer(), xs, runparams); + if (opts & WriteInnerTag) xs << html::EndTag(il.htmlinnertag()); + if (opts & WriteOuterTag) xs << html::EndTag(il.htmltag()); + return docstring(); }