From 9571592de0f9b6ef9809139d01869c4e8912d5ed Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Tue, 11 Apr 2017 07:53:59 -0600 Subject: [PATCH] Trim whitespace at bottom of entry --- page.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/page.go b/page.go index e78d147..0d22066 100755 --- a/page.go +++ b/page.go @@ -60,9 +60,18 @@ func DecodeFileName(s string) string { return s2 } +// Update cleans the text and updates the versioned text +// and generates a new render func (p *Page) Update(newText string) error { + // Trim space from end + newText = strings.TrimRight(newText, "\n\t ") + + // Update the versioned text p.Text.Update(newText) + + // Render the new page p.Render() + return p.Save() }