Explorar o código

Parse should reset the parser

Chris Watson %!s(int64=5) %!d(string=hai) anos
pai
achega
e678797dcf
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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) {