From be94d5fa266e1917375a1f09a012bac923b889d6 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Mon, 14 Mar 2016 00:23:10 -0400 Subject: strip extra body attr whitespace --- src/guff/views/ecrs/page.ecr | 2 +- src/guff/views/html/page.cr | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/guff/views') diff --git a/src/guff/views/ecrs/page.ecr b/src/guff/views/ecrs/page.ecr index e009ac1..aaccb30 100644 --- a/src/guff/views/ecrs/page.ecr +++ b/src/guff/views/ecrs/page.ecr @@ -6,7 +6,7 @@ <%= page_headers %> - ><%= + ><%= @body %> 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 -- cgit v1.2.3