first working version
This commit is contained in:
parent
14e0611f06
commit
85f93bae69
32 changed files with 863 additions and 571 deletions
|
|
@ -10,14 +10,14 @@ import (
|
|||
|
||||
"git.giftfish.de/ston1th/gowiki/pkg/core"
|
||||
"github.com/blevesearch/bleve/analysis"
|
||||
htmlFilter "github.com/blevesearch/bleve/analysis/char_filters/html_char_filter"
|
||||
"github.com/blevesearch/bleve/analysis/char/html"
|
||||
"github.com/russross/blackfriday"
|
||||
)
|
||||
|
||||
var filter = makeFilter()
|
||||
|
||||
func makeFilter() analysis.CharFilter {
|
||||
f, _ := htmlFilter.CharFilterConstructor(nil, nil)
|
||||
f, _ := html.CharFilterConstructor(nil, nil)
|
||||
return f
|
||||
}
|
||||
|
||||
|
|
@ -35,8 +35,8 @@ func Render(p *core.Page) string {
|
|||
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"`, -1)
|
||||
p.Index = template.HTML(index)
|
||||
p.Text = template.HTML(html)
|
||||
p.PageIndex = template.HTML(index)
|
||||
p.HTML = template.HTML(html)
|
||||
return whiteSpace.ReplaceAllString(string(filter.Filter(rend)), " ")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue