mirror of
https://github.com/documize/community.git
synced 2025-08-04 21:15:24 +02:00
removed experimental code
This commit is contained in:
parent
fddaf9effe
commit
7455a027fc
38 changed files with 1 additions and 499578 deletions
|
@ -14,11 +14,9 @@ package convert
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/documize/community/core/api/convert/excerpt"
|
||||
"github.com/documize/community/core/api/convert/html"
|
||||
"github.com/documize/community/core/api/plugins"
|
||||
api "github.com/documize/community/core/convapi"
|
||||
"github.com/documize/community/core/utility"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
@ -49,32 +47,6 @@ func Convert(ctx context.Context, xtn string, fileRequest *api.DocumentConversio
|
|||
}
|
||||
*/
|
||||
|
||||
if fileResult.Excerpt != "" {
|
||||
//fmt.Println("DEBUG supplied excerpt: " + fileResult.Excerpt)
|
||||
} else {
|
||||
titleWds := []string{}
|
||||
bodyWds := []string{}
|
||||
for p := range fileResult.Pages {
|
||||
var wds []string
|
||||
var err error
|
||||
if p > 0 { // title 0 is already the title of the document
|
||||
wds, _, err = utility.Words(utility.HTML(fileResult.Pages[p].Title), 0, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
titleWds = append(titleWds, wds...)
|
||||
titleWds = append(titleWds, ".")
|
||||
}
|
||||
wds, _, err = utility.Words(utility.HTML(string(fileResult.Pages[p].Body)), 0, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bodyWds = append(bodyWds, wds...)
|
||||
bodyWds = append(bodyWds, ".")
|
||||
}
|
||||
fileResult.Excerpt = excerpt.Excerpt(titleWds, bodyWds)
|
||||
}
|
||||
|
||||
return fileResult, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue