Remove whitespace from id links, fix <br> closing
This commit is contained in:
parent
79d69f4b65
commit
d1358f7e77
@ -60,7 +60,7 @@ std::string HandlerPageView::createIndexContent(IParser &parser, std::string con
|
|||||||
}
|
}
|
||||||
previous = h.level;
|
previous = h.level;
|
||||||
HtmlLink link;
|
HtmlLink link;
|
||||||
link.href = "#" + h.title;
|
link.href = "#" + utils::strreplace(h.title, " ", "");
|
||||||
link.innervalue = h.title;
|
link.innervalue = h.title;
|
||||||
link.cssclass = "indexlink";
|
link.cssclass = "indexlink";
|
||||||
indexcontent += "<li>" + link.render() + "</li>";
|
indexcontent += "<li>" + link.render() + "</li>";
|
||||||
|
@ -191,6 +191,10 @@ std::string Parser::parse(const PageDao &pagedao, UrlProvider &provider, const s
|
|||||||
{
|
{
|
||||||
newlines = "<br>";
|
newlines = "<br>";
|
||||||
}
|
}
|
||||||
|
if(tag == "br")
|
||||||
|
{
|
||||||
|
return std::string("<br>");
|
||||||
|
}
|
||||||
if(tag != "code" && tag != "blockquote")
|
if(tag != "code" && tag != "blockquote")
|
||||||
{
|
{
|
||||||
content = parse(pagedao, provider, content, callback);
|
content = parse(pagedao, provider, content, callback);
|
||||||
@ -220,7 +224,7 @@ std::string Parser::parse(const PageDao &pagedao, UrlProvider &provider, const s
|
|||||||
}
|
}
|
||||||
if(tag[0] == 'h')
|
if(tag[0] == 'h')
|
||||||
{
|
{
|
||||||
return "<" + tag + " id='" + content + "'>" + content + "</" + tag + ">";
|
return "<" + tag + " id='" + utils::strreplace(content, " ", "") + "'>" + content + "</" + tag + ">";
|
||||||
}
|
}
|
||||||
if(tag == "code" || tag == "blockquote")
|
if(tag == "code" || tag == "blockquote")
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user