diff --git a/quote.go b/quote.go index c662af5..6a63b33 100644 --- a/quote.go +++ b/quote.go @@ -23,6 +23,7 @@ func (b *Quote) printHTML(p *printer) { } func (b *Quote) printMarkdown(p *printer) { + p.maybeNL() p.maybeQuoteNL('>') p.WriteString("> ") defer p.pop(p.push("> ")) diff --git a/table.go b/table.go index 8348f22..1779a11 100644 --- a/table.go +++ b/table.go @@ -93,6 +93,7 @@ func (t *Table) printMarkdown(p *printer) { rows = append(rows, xrow) } + p.maybeNL() p.maybeQuoteNL('|') for i, cell := range hdr { p.WriteString("| ") diff --git a/testdata/basic_fmt.txt b/testdata/basic_fmt.txt index 2af285b..c5aa8a3 100644 --- a/testdata/basic_fmt.txt +++ b/testdata/basic_fmt.txt @@ -229,6 +229,7 @@ placed within the reach of poodles. The end. -- want -- As Celine said: + > Love is the infinite > placed within the reach of poodles. diff --git a/testdata/table_fmt.txt b/testdata/table_fmt.txt index 0d9b737..a7e9029 100644 --- a/testdata/table_fmt.txt +++ b/testdata/table_fmt.txt @@ -41,3 +41,10 @@ | --- | -------- | --- | | 1 | 22345678 | 3 | | a | b | c | +-- preceding text -- +Text. + +| foo | bar | baz | +| --- | -------- | --- | +| 1 | 22345678 | 3 | +| a | b | c |