From 689f6cb79b7436f387720213cb6a9810649762b6 Mon Sep 17 00:00:00 2001 From: Russ Ross Date: Fri, 1 Jul 2011 11:19:42 -0600 Subject: [PATCH] more consistent spacing of block-level elements --- block.go | 2 ++ block_test.go | 22 ++++++++++---------- html.go | 12 +++++++---- markdown.go | 1 + upskirtref/Auto links.html | 2 ++ upskirtref/Blockquotes with code blocks.html | 2 +- upskirtref/Nested blockquotes.html | 4 +++- upskirtref/Ordered and unordered lists.html | 14 +++++++++++++ upskirtref/Tabs.html | 1 + upskirtref/Tidyness.html | 2 +- 10 files changed, 44 insertions(+), 18 deletions(-) diff --git a/block.go b/block.go index 8ad2193..d2aec77 100644 --- a/block.go +++ b/block.go @@ -942,6 +942,7 @@ func (parser *Parser) blockOliPrefix(data []byte) int { // parse ordered or unordered list block func (parser *Parser) blockList(out *bytes.Buffer, data []byte, flags int) int { i := 0 + flags |= LIST_ITEM_BEGINNING_OF_LIST work := func() bool { j := 0 for i < len(data) { @@ -951,6 +952,7 @@ func (parser *Parser) blockList(out *bytes.Buffer, data []byte, flags int) int { if j == 0 || flags&LIST_ITEM_END_OF_LIST != 0 { break } + flags &= ^LIST_ITEM_BEGINNING_OF_LIST } return true } diff --git a/block_test.go b/block_test.go index e6e9f98..888841e 100644 --- a/block_test.go +++ b/block_test.go @@ -86,10 +86,10 @@ func TestPrefixHeaderNoExtensions(t *testing.T) { "

Hello

\n\n

Header 1

\n\n

Goodbye

\n", "* List\n# Header\n* List\n", - "\n", + "\n", "* List\n#Header\n* List\n", - "\n", + "\n", "* List\n * Nested list\n # Nested header\n", "