3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
14 #include "support/std_ostream.h"
16 #include "paragraph.h"
29 pair<bool, string> escapeChar(char c)
35 return make_pair(true, string(" "));
37 case '\0': // Ignore :-)
85 return make_pair(false, str);
89 int openTag(ostream & os, Paragraph::depth_type depth,
90 bool mixcont, string const & latexname,
91 string const & latexparam)
93 if (!latexname.empty() && latexname != "!-- --") {
95 os << string(depth, ' ');
96 os << '<' << latexname;
97 if (!latexparam.empty())
98 os << " " << latexparam;
109 int closeTag(ostream & os, Paragraph::depth_type depth,
110 bool mixcont, string const & latexname)
112 if (!latexname.empty() && latexname != "!-- --") {
114 os << endl << string(depth, ' ');
115 os << "</" << latexname << '>';
125 unsigned int closeEnvTags(ostream & os, bool mixcont,
126 string const & environment_inner_depth,
127 string const & itemtag,
128 lyx::depth_type total_depth)
130 unsigned int lines = 0;
131 if (environment_inner_depth != "!-- --") {
132 lines += closeTag(os, total_depth, mixcont, itemtag);
133 if (!environment_inner_depth.empty())
134 lines += closeTag(os, total_depth, mixcont,
135 environment_inner_depth);