From 33ddb58e172346a3036f63f7730c7711d611789d Mon Sep 17 00:00:00 2001 From: Wendal Chen Date: Sat, 5 Jan 2013 13:38:16 +0800 Subject: [PATCH] ignore small parse error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ignore parse error likeĀ  unnecessary blankspace tab \r or \n --- markdown.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/markdown.go b/markdown.go index 555ec9e..038b6f6 100644 --- a/markdown.go +++ b/markdown.go @@ -106,8 +106,9 @@ L: } func (p *Parser) parseRule(rule int, s string) (tree *element) { - if p.yy.ResetBuffer(s) != "" { - log.Fatalf("Buffer not empty") + _old := p.yy.ResetBuffer(s) + if _old != "" && if strings.Trim(_old, "\t\r\n ") != "" { + log.Fatalln("Buffer not empty", "["+_old+"]") } err := p.yy.Parse(rule) switch rule {