This commit is contained in:
Liang Ding 2022-11-14 20:54:58 +08:00
parent c6b20179a6
commit c403842c8b
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 3 additions and 3 deletions

View file

@ -76,6 +76,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
} else if (!event.repeat) { } else if (!event.repeat) {
hideElements(["toolbar"], protyle); hideElements(["toolbar"], protyle);
} }
console.log(event)
const range = getEditorRange(protyle.wysiwyg.element); const range = getEditorRange(protyle.wysiwyg.element);
const nodeElement = hasClosestBlock(range.startContainer); const nodeElement = hasClosestBlock(range.startContainer);
if (!nodeElement) { if (!nodeElement) {

View file

@ -25,7 +25,6 @@ import (
"strings" "strings"
"github.com/88250/gulu" "github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/siyuan-note/logging" "github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/model" "github.com/siyuan-note/siyuan/kernel/model"
@ -330,8 +329,8 @@ func exportAsFile(c *gin.Context) {
return return
} }
ext := filepath.Ext(file.Filename) name := "export-file-" + file.Filename
name := "save-as-file-" + ast.NewNodeID() + ext name = util.FilterFileName(name)
tmpDir := filepath.Join(util.TempDir, "export") tmpDir := filepath.Join(util.TempDir, "export")
if err = os.MkdirAll(tmpDir, 0755); nil != err { if err = os.MkdirAll(tmpDir, 0755); nil != err {
logging.LogErrorf("export as file failed: %s", err) logging.LogErrorf("export as file failed: %s", err)