feat: implement restore nodes

This commit is contained in:
Steven
2023-12-28 22:35:39 +08:00
parent 2a6f054876
commit 46f7cffc7b
34 changed files with 264 additions and 154 deletions

View File

@ -7,6 +7,7 @@ import (
"github.com/usememos/memos/plugin/gomark/ast"
"github.com/usememos/memos/plugin/gomark/parser/tokenizer"
"github.com/usememos/memos/plugin/gomark/restore"
)
func TestEscapingCharacterParser(t *testing.T) {
@ -25,6 +26,6 @@ func TestEscapingCharacterParser(t *testing.T) {
for _, test := range tests {
tokens := tokenizer.Tokenize(test.text)
node, _ := NewEscapingCharacterParser().Parse(tokens)
require.Equal(t, StringifyNodes([]ast.Node{test.node}), StringifyNodes([]ast.Node{node}))
require.Equal(t, restore.Restore([]ast.Node{test.node}), restore.Restore([]ast.Node{node}))
}
}