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 :-)
83 return make_pair(false, str);
87 int openTag(ostream & os, Paragraph::depth_type depth,
88 bool mixcont, string const & latexname,
89 string const & latexparam)
91 if (!latexname.empty() && latexname != "!-- --") {
93 os << string(depth, ' ');
94 os << '<' << latexname;
95 if (!latexparam.empty())
96 os << " " << latexparam;
107 int closeTag(ostream & os, Paragraph::depth_type depth,
108 bool mixcont, string const & latexname)
110 if (!latexname.empty() && latexname != "!-- --") {
112 os << endl << string(depth, ' ');
113 os << "</" << latexname << '>';
123 unsigned int closeEnvTags(ostream & os, bool mixcont,
124 string const & environment_inner_depth,
125 string const & itemtag,
126 lyx::depth_type total_depth)
128 unsigned int lines = 0;
129 if (environment_inner_depth != "!-- --") {
130 lines += closeTag(os, total_depth, mixcont, itemtag);
131 if (!environment_inner_depth.empty())
132 lines += closeTag(os, total_depth, mixcont,
133 environment_inner_depth);