+// replaces '\t', ' ' and '\n' with HTML markup:
+static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str)
+{
+ wxString out;
+ out.reserve(str.length()); // we'll certainly need at least that
+
+ const wxString::const_iterator end = str.end();
+ for ( wxString::const_iterator i = str.begin(); i != end; ++i )
+ {
+ switch ( (*i).GetValue() )
+ {
+ case '<':
+ while ( i != end && *i != '>' )
+ {
+ out << *i++;
+ }
+ out << '>';
+ if ( i == end )
+ return out;
+ break;
+ case '\n':
+ out << "<br>";
+ break;
+ default:
+ out << *i;
+ break;
+ }
+ }
+
+ return out;
+}
+
+