From 25407914ccc01ba0e27543b6533d4740a7a5826f Mon Sep 17 00:00:00 2001 From: Romaric Mourgues Date: Thu, 31 Mar 2022 12:27:22 +0200 Subject: [PATCH 1/2] Update render_test.go --- render_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render_test.go b/render_test.go index b565ff3..c1c94af 100644 --- a/render_test.go +++ b/render_test.go @@ -15,7 +15,7 @@ func TestSimple(t *testing.T) { }{ "empty": { ops: `[{"insert": "\n"}]`, - want: "


", + want: "


", }, "two paragraphs (single op)": { ops: `[{"insert": "line1\nline2\n"}]`, @@ -23,7 +23,7 @@ func TestSimple(t *testing.T) { }, "blank line": { ops: `[{"insert": "line1\n\nline3\n"}]`, - want: "

line1


line3

", + want: "

line1


line3

", }, "blockquote": { ops: `[{"insert": "bkqt"}, {"attributes": {"blockquote": true}, "insert": "\n"}]`, From d0ea8cb4ff3059a1b1f4c5508adf09c5a9d3cf52 Mon Sep 17 00:00:00 2001 From: Romaric Mourgues Date: Thu, 31 Mar 2022 12:27:55 +0200 Subject: [PATCH 2/2] Update render.go --- render.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render.go b/render.go index 7ae1ce8..b0e4ec9 100644 --- a/render.go +++ b/render.go @@ -211,7 +211,7 @@ func (o *Op) writeBlock(vars *renderVars) { // Avoid empty paragraphs and "\n" in the output for text blocks. if o.Data == "" && block.tagName == "p" && vars.tempBuf.Len() == 0 { - o.Data = "
" + o.Data = "
" } if block.tagName != "" { @@ -227,7 +227,7 @@ func (o *Op) writeBlock(vars *renderVars) { vars.finalBuf.Write(vars.tempBuf.Bytes()) // Copy the temporary buffer to the final output. - vars.finalBuf.WriteString(o.Data) // Copy the data of the current Op (usually just "
" or blank). + vars.finalBuf.WriteString(o.Data) // Copy the data of the current Op (usually just "
" or blank). if block.tagName != "" { closeTag(&vars.finalBuf, block.tagName)