aboutsummaryrefslogtreecommitdiff
path: root/src/guff/views/html
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-03-14 00:23:10 -0400
committerPaul Duncan <pabs@pablotron.org>2016-03-14 00:23:10 -0400
commitbe94d5fa266e1917375a1f09a012bac923b889d6 (patch)
tree63d302723ad718b4049bdd90f9b53b95721148f1 /src/guff/views/html
parent3e1697e737cae24ba398f7062c27ce4ced2b8626 (diff)
downloadold-guff-be94d5fa266e1917375a1f09a012bac923b889d6.tar.bz2
old-guff-be94d5fa266e1917375a1f09a012bac923b889d6.zip
strip extra body attr whitespace
Diffstat (limited to 'src/guff/views/html')
-rw-r--r--src/guff/views/html/page.cr7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/guff/views/html/page.cr b/src/guff/views/html/page.cr
index a902e0b..6ea9502 100644
--- a/src/guff/views/html/page.cr
+++ b/src/guff/views/html/page.cr
@@ -31,10 +31,13 @@ module Guff
end
def body_attrs
- {
+ r = {
"id": @body_id,
"class": @body_class,
- }.map { |k, v| attr(k, v) }.join(" ")
+ }.map { |k, v| attr(k, v) }.join(" ").strip
+
+ # prefix with space if content
+ " " + r if r.size > 0
end
def page_headers : String