From db954caf8b19879b9ae82f290fb429063ae2e37f Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 8 Jul 2016 16:38:37 -0400 Subject: [PATCH] Write magic paragraph label to main paragraph tag. --- src/output_xhtml.cpp | 15 ++++++--------- src/output_xhtml.h | 10 ++-------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index c6b3c7875d..cc43e62c08 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -135,16 +135,13 @@ docstring EndTag::writeEndTag() const } -docstring ParTag::writeTag() const +ParTag::ParTag(std::string const & tag, std::string attr, + std::string const & parid) + : StartTag(tag) { - docstring output = StartTag::writeTag(); - - if (parid_.empty()) - return output; - - string const pattr = "id='" + parid_ + "'"; - output += html::CompTag("a", pattr).writeTag(); - return output; + if (!parid.empty()) + attr += " id='" + parid + "'"; + attr_ = attr; } diff --git a/src/output_xhtml.h b/src/output_xhtml.h index a2eac95ab4..2b1704742c 100644 --- a/src/output_xhtml.h +++ b/src/output_xhtml.h @@ -117,16 +117,10 @@ struct CompTag struct ParTag : public StartTag { /// - explicit ParTag(std::string const & tag, std::string const & attr, - std::string const & parid) - : StartTag(tag, attr), parid_(parid) - {} + explicit ParTag(std::string const & tag, std::string attr, + std::string const & parid); /// ~ParTag() {} - /// - docstring writeTag() const; - /// the "magic par label" for this paragraph - std::string parid_; }; -- 2.39.2