From 67035183005309de2154c143ae3df05dfe096903 Mon Sep 17 00:00:00 2001 From: yuin Date: Wed, 15 May 2019 22:56:52 +0900 Subject: [PATCH] Issue #4: Fix invalid leading spaces with attributes --- parser/atx_heading.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser/atx_heading.go b/parser/atx_heading.go index b7fe672..92a92dd 100644 --- a/parser/atx_heading.go +++ b/parser/atx_heading.go @@ -94,7 +94,9 @@ func (b *atxHeadingParser) Open(parent ast.Node, reader text.Reader, pc Context) node := ast.NewHeading(level) parsed := false if b.Attribute { // handles special case like ### heading ### {#id} - start-- + if line[start] == '#' { + start-- + } closureOpen := -1 closureClose := -1 for i := start; i < stop; {