RichText: EncodeHTML fix

git-svn-id: svn://ultimatepp.org/upp/trunk@15528 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-11-27 16:01:36 +00:00
parent 872d83d5af
commit adea4df7e8
4 changed files with 20 additions and 19 deletions

View file

@ -246,8 +246,7 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index<String>& css,
endtag = "</a>";
}
String cs;
if(part.text[0] != 9)
cs = HtmlCharStyle(part.format, p.format);
cs = HtmlCharStyle(part.format, p.format);
if(!cs.IsEmpty()) {
html << "<span" << FormatClass(css, cs) << ">";
endtag = "</span>" + endtag;
@ -392,4 +391,20 @@ String AsCss(Index<String>& ss)
return css;
}
String MakeHtml(const char *title, const String& css, const String& body)
{
String h =
"<HTML>\r\n"
"<HEAD>\t\n"
"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\t\n"
"<META NAME=\"Generator\" CONTENT=\"U++ HTML Package\">\t\n"
"<TITLE>" + String(title) + "</TITLE>\r\n"
;
if(!IsNull(css))
h << "<STYLE TYPE=\"text/css\"><!--\r\n"
<< css << "\r\n-->\r\n</STYLE>\r\n";
h << "</HEAD><BODY>" << body << "</BODY>";
return h;
}
}