Transforming comment lines to strings should preserve intermediate whitespace where possible.

Preserving whitespace allows for indentation-sensitive markdown constructs,
like code block, within comments.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
This commit is contained in:
Deepak Giridharagopal 2012-01-21 09:27:51 -08:00
parent 7efe1c4666
commit 699ebe460f

View file

@ -247,7 +247,9 @@
(dispatch-form form raw nspace-sym)))
(defn- ->str [m]
(replace (-> m :form .content) #"^;+\s*" ""))
(-> (-> m :form .content)
(replace #"^;+\s(\s*)" "$1")
(replace #"^;+" "")))
(defn merge-comments [f s]
{:form (Comment. (str (->str f) "\n" (->str s)))