diff --git a/block.go b/block.go index 8ad21935..d2aec77d 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 e6e9f984..888841e4 100644 --- a/block_test.go +++ b/block_test.go @@ -86,10 +86,10 @@ func TestPrefixHeaderNoExtensions(t *testing.T) { "
Hello
\n\nGoodbye
\n", "* List\n# Header\n* List\n", - "List
\n\nList
List
\n\nList
List
\n\nList
List
\n\nList
List
\n\nNested list
\n\n" + @@ -146,7 +146,7 @@ func TestPrefixHeaderSpaceExtension(t *testing.T) { "Hello
\n\nGoodbye
\n", "* List\n# Header\n* List\n", - "List
\n\nList
List
\n\nList
Yin
Yang
Yin
Yang
Ting
Bong
Goo
Ting
Bong
Goo
Yin
Yang
Yin
Yang
Ting
Bong
Goo
Ting
Bong
Goo
Yin
Yang
Yin
Yang
Ting
Bong
Goo
Ting
Bong
Goo
*Hello
\n", @@ -393,10 +393,10 @@ func TestOrderedList(t *testing.T) { "Yin
Yang
Yin
Yang
Ting
Bong
Goo
Ting
Bong
Goo
1 Hello
\n", diff --git a/html.go b/html.go index f0d8cf22..c71ca0e2 100644 --- a/html.go +++ b/html.go @@ -252,9 +252,10 @@ func (options *Html) BlockCodeGithub(out *bytes.Buffer, text []byte, lang string func (options *Html) BlockQuote(out *bytes.Buffer, text []byte) { + doubleSpace(out) out.WriteString("\n") out.Write(text) - out.WriteString("") + out.WriteString("\n") } func (options *Html) Table(out *bytes.Buffer, header []byte, body []byte, columnData []int) { @@ -263,7 +264,7 @@ func (options *Html) Table(out *bytes.Buffer, header []byte, body []byte, column out.Write(header) out.WriteString("\n\n\n") out.Write(body) - out.WriteString("\n\n") + out.WriteString("\n\n\n") } func (options *Html) TableRow(out *bytes.Buffer, text []byte) { @@ -295,9 +296,9 @@ func (options *Html) List(out *bytes.Buffer, text func() bool, flags int) { doubleSpace(out) if flags&LIST_TYPE_ORDERED != 0 { - out.WriteString("
+Blockquoted: http://example.com/
Auto-links should not occur here: <http://example.com/>
or here: <http://example.com/>
diff --git a/upskirtref/Blockquotes with code blocks.html b/upskirtref/Blockquotes with code blocks.html
index fa643354..360fa9b1 100644
--- a/upskirtref/Blockquotes with code blocks.html
+++ b/upskirtref/Blockquotes with code blocks.html
@@ -12,4 +12,4 @@
return "working";
}
-
\ No newline at end of file
+
diff --git a/upskirtref/Nested blockquotes.html b/upskirtref/Nested blockquotes.html
index f1b017e9..538bb4fe 100644
--- a/upskirtref/Nested blockquotes.html
+++ b/upskirtref/Nested blockquotes.html
@@ -1,7 +1,9 @@
\ No newline at end of file + diff --git a/upskirtref/Ordered and unordered lists.html b/upskirtref/Ordered and unordered lists.html index e3219f20..d6fa4278 100644 --- a/upskirtref/Ordered and unordered lists.html +++ b/upskirtref/Ordered and unordered lists.html @@ -12,7 +12,9 @@foo
++bar
foo
-
asterisk 1
asterisk 2
asterisk 3
Plus 1
Plus 2
Plus 3
Minus 1
Minus 2
Minus 3
First
Second
Third
One
Two
Three
Item 2. graf two. The quick brown fox jumped over the lazy dog's back.
Item 2.
Item 3.
First
Second:
Third
this is a list item indented with tabs
this is a list item indented with spaces