work in progress
This commit is contained in:
parent
38f7c31517
commit
07ff5ccffb
23 changed files with 228 additions and 240 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"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/russross/blackfriday"
|
||||
|
|
@ -28,7 +29,7 @@ var (
|
|||
titleRe = regexp.MustCompile("[^a-zA-Z0-9 -]+")
|
||||
)
|
||||
|
||||
func Render(p *Page) string {
|
||||
func Render(p *core.Page) string {
|
||||
rend := blackfriday.MarkdownCommon([]byte(p.Markdown))
|
||||
index, html := buildIndex(string(rend))
|
||||
html = strings.Replace(html, "<table>", `<table class="table">`, -1)
|
||||
|
|
@ -117,11 +118,12 @@ func closeTag(j int) (ret string) {
|
|||
return
|
||||
}
|
||||
|
||||
func renderResult(res []Result) (html string) {
|
||||
func renderResult(res []core.Result) (html string) {
|
||||
//TODO fmt.Sprintf ?
|
||||
for r := range res {
|
||||
html += `<a href="/` + r.LinkTitle + `"><b>` + r.Title + "</b></a>" +
|
||||
for _, r := range res {
|
||||
html += `<a href="/` + r.StoreTitle + `"><b>` + r.Title + "</b></a>" +
|
||||
`<pre style="white-space: pre-wrap">` + r.Text + "</pre><br>"
|
||||
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue