Kaynağa Gözat

Parse should reset the parser

Chris Watson 5 yıl önce
ebeveyn
işleme
e678797dcf
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  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) {