mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 15:06:46 +08:00
This commit is contained in:
1 parent
2ea937b7be
commit
1c7f3c03e9
6 files changed
+189
-11
No files matched your search
@@ -164,6 +164,14 @@ func renderPage(args []js.Value) (any, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
text, err := currentSession.PageText(args[0].Int())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
textData, err := json.Marshal(text)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
links := make([]any, len(page.Links))
|
||||
for i, link := range page.Links {
|
||||
links[i] = map[string]any{
|
||||
@@ -182,6 +190,7 @@ func renderPage(args []js.Value) (any, error) {
|
||||
"height": page.Height,
|
||||
"svg": page.SVG,
|
||||
"links": links,
|
||||
"text": js.Global().Get("JSON").Call("parse", string(textData)),
|
||||
}), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user