remove newline at the end of codeblocks
This commit is contained in:
parent
d9d089be0d
commit
94762c62e4
1 changed files with 5 additions and 4 deletions
|
|
@ -33,9 +33,10 @@ var (
|
|||
func Render(p *core.Page) string {
|
||||
rend := blackfriday.MarkdownCommon([]byte(p.Markdown))
|
||||
toc, html := buildTOC(string(rend))
|
||||
html = strings.Replace(html, "<table>", `<table class="table">`, -1)
|
||||
html = strings.Replace(html, "</h1>", `</h1><hr>`, -1)
|
||||
html = strings.Replace(html, "<a", `<a target="_blank" rel="noopener noreferrer"`, -1)
|
||||
html = strings.ReplaceAll(html, "<table>", `<table class="table">`)
|
||||
html = strings.ReplaceAll(html, "</h1>", `</h1><hr>`)
|
||||
html = strings.ReplaceAll(html, "<a", `<a target="_blank" rel="noopener noreferrer"`)
|
||||
html = strings.ReplaceAll(html, "\n</code", "</code")
|
||||
p.TOC = template.HTML(toc)
|
||||
p.HTML = template.HTML(html)
|
||||
return whiteSpace.ReplaceAllString(string(filter.Filter(rend)), " ")
|
||||
|
|
@ -128,7 +129,7 @@ func closeTag(j int) (ret string) {
|
|||
ret += "</li></ul></li>"
|
||||
}
|
||||
if j > 1 {
|
||||
ret = strings.Replace(ret, "</li></li>", "</li>", -1)
|
||||
ret = strings.ReplaceAll(ret, "</li></li>", "</li>")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue