瀏覽代碼

Parse should reset the parser

Chris Watson 5 年之前
父節點
當前提交
e678797dcf
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      gramjs/extensions/Markdown.js

+ 6 - 0
gramjs/extensions/Markdown.js

@@ -28,6 +28,10 @@ class MarkdownParser extends Scanner {
     }
 
     parse() {
+        // Do a little reset
+        this.stripped = ''
+        this.entities = []
+
         while (!this.eof()) {
             switch (this.chr) {
             case '*':
@@ -55,6 +59,8 @@ class MarkdownParser extends Scanner {
                 this.pos += 1
             }
         }
+
+        return [this.stripped, this.entities]
     }
 
     static unparse(text, entities) {