X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsgml.C;h=7ebaf187a694782a4d7f21052c1fc83b7372b79a;hb=67f9c9fdae42211aa3ff8d0c6f62485bd721d8eb;hp=db91894847e2a061ccf60edacadefff47811cd64;hpb=4c6e0fe4226ce3b55d13726977f1e579f17c2ad1;p=lyx.git diff --git a/src/sgml.C b/src/sgml.C index db91894847..7ebaf187a6 100644 --- a/src/sgml.C +++ b/src/sgml.C @@ -21,6 +21,7 @@ using std::make_pair; using std::ostream; using std::pair; +using std::string; namespace sgml { @@ -84,12 +85,16 @@ pair escapeChar(char c) int openTag(ostream & os, Paragraph::depth_type depth, - bool mixcont, string const & latexname) + bool mixcont, string const & latexname, + string const & latexparam) { if (!latexname.empty() && latexname != "!-- --") { if (!mixcont) os << string(depth, ' '); - os << '<' << latexname << '>'; + os << '<' << latexname; + if (!latexparam.empty()) + os << " " << latexparam; + os << '>'; } if (!mixcont) @@ -114,4 +119,21 @@ int closeTag(ostream & os, Paragraph::depth_type depth, return !mixcont; } + +unsigned int closeEnvTags(ostream & os, bool mixcont, + string const & environment_inner_depth, + string const & itemtag, + lyx::depth_type total_depth) +{ + unsigned int lines = 0; + if (environment_inner_depth != "!-- --") { + lines += closeTag(os, total_depth, mixcont, itemtag); + if (!environment_inner_depth.empty()) + lines += closeTag(os, total_depth, mixcont, + environment_inner_depth); + } + return lines; +} + + } // namespace sgml