RichText: EncodeHTML now treats labels HTML5 compatible

git-svn-id: svn://ultimatepp.org/upp/trunk@11263 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-07-19 21:58:21 +00:00
parent 502b997c7e
commit 8dd0ad4ef7
2 changed files with 158 additions and 163 deletions

View file

@ -190,12 +190,7 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index<String>& css,
RichPara p = text.Get(i, styles);
if(p.format.ruler)
html << "<hr>";
String lbl;
if(!IsNull(p.format.label)) {
lbl = labels.Get(p.format.label, Null);
if(lbl.GetCount())
html << "<a name=\"" << lbl << "\">";
}
String lbl = labels.Get(p.format.label, p.format.label);
bool bultext = false;
if(p.format.bullet == RichPara::BULLET_TEXT)
for(int i = 0; i < p.part.GetCount(); i++) {
@ -216,7 +211,10 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index<String>& css,
max(z * p.format.indent, 0));
p.format.ruler = p.format.after = p.format.before = p.format.indent = p.format.lm = 0;
}
String par = "<p" + FormatClass(css, HtmlParaStyle(p.format, z)) + ">";
String par = "<p";
if(lbl.GetCount())
par << " id=\"" << lbl << "\"";
par << FormatClass(css, HtmlParaStyle(p.format, z)) << ">";
html << par;
for(int i = 0; i < p.part.GetCount(); i++) {
const RichPara::Part& part = p.part[i];
@ -316,8 +314,6 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index<String>& css,
html << "</p>";
if(bultext)
html << "</td></tr></table>";
if(lbl.GetCount())
html << "</a>";
html << "\r\n";
}
}