feat: implement restore nodes

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

No files matched your search

+1 -4
View File
@@ -40,7 +40,7 @@ func (*CodeBlockParser) Match(tokens []*tokenizer.Token) (int, bool) {
matched = true
break
} else if tokens[cursor+4].Type == tokenizer.Newline {
cursor += 5
cursor += 4
matched = true
break
}
@@ -65,9 +65,6 @@ func (p *CodeBlockParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) {
languageToken = nil
contentStart = 4
}
if tokens[size-1].Type == tokenizer.Newline {
contentEnd = size - 5
}
codeBlock := &ast.CodeBlock{
Content: tokenizer.Stringify(tokens[contentStart:contentEnd]),