+2004-10-25 José Matos <jamatos@lyx.org>
+
+ * sgml.[Ch] (escapeString): new function to escape all the string.
+
2004-10-24 José Matos <jamatos@lyx.org>
* paragraph.[Ch] (getFirstWord): new function to get the first
+2004-10-24 Andreas Vox <vox@isp.uni-luebeck.de>
+
+ * insetindex.C (docbook): escape the index, to generate correct sgml.
+
2004-10-23 José Matos <jamatos@lyx.org>
* insettext.C (docbook): rearrange arguments, due to change in the upper
#include "gettext.h"
#include "LaTeXFeatures.h"
#include "metricsinfo.h"
+#include "sgml.h"
#include "support/std_ostream.h"
int InsetIndex::docbook(Buffer const &, ostream & os,
OutputParams const &) const
{
- os << "<indexterm><primary>" << getContents()
+ os << "<indexterm><primary>" << sgml::escapeString(getContents())
<< "</primary></indexterm>";
return 0;
}
#include "support/std_ostream.h"
#include "support/tostr.h"
+#include <sstream>
+
using lyx::support::subst;
using std::make_pair;
using std::ostream;
+using std::ostringstream;
using std::pair;
using std::string;
-
namespace sgml {
pair<bool, string> escapeChar(char c)
}
+string escapeString(string const & raw)
+{
+ ostringstream bin;
+
+ for(int i=0; i < raw.size(); ++i) {
+ bool ws;
+ string str;
+ boost::tie(ws, str) = sgml::escapeChar(raw[i]);
+ bin << str;
+ }
+ return bin.str();
+}
+
+
int openTag(Buffer const & buf, ostream & os, Paragraph::depth_type depth,
bool mixcont, string const & name, string const & param)
{
*/
std::pair<bool, std::string> escapeChar(char c);
+/// Escape a word instead of a single character
+std::string escapeString(std::string const & raw);
+
/// Opens tag
int openTag(Buffer const & buf, std::ostream & os, lyx::depth_type depth,
bool mixcont, std::string const & name,