From 498cd667f9f5327c4b4c7445b5367abd8d48e479 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 25 Jan 2018 03:41:44 -0800 Subject: [PATCH] Preserve whitespace around time when reformatting. --- src/Miscellaneous/Time.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Miscellaneous/Time.coffee b/src/Miscellaneous/Time.coffee index d1343e058..b8900636c 100644 --- a/src/Miscellaneous/Time.coffee +++ b/src/Miscellaneous/Time.coffee @@ -8,7 +8,9 @@ Time = node: -> return if @isClone - @nodes.date.textContent = Time.format Conf['time'], @info.date + {textContent} = @nodes.date + @nodes.date.textContent = textContent.match(/^\s*/)[0] + Time.format(Conf['time'], @info.date) + textContent.match(/\s*$/)[0] + format: (formatString, date) -> formatString.replace /%(.)/g, (s, c) -> if c of Time.formatters