Skip to content

Commit

Permalink
Added the <pomo:textToParagraphs> tag that makes paragraphs within ta…
Browse files Browse the repository at this point in the history
…sk details visible in the browser.
  • Loading branch information
pledbrook committed Jun 13, 2011
1 parent ba5551b commit 6b41c1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions grails-app/taglib/org/example/pomodoro/MainTagLib.groovy
Expand Up @@ -33,4 +33,8 @@ class MainTagLib {

out << "<span class=\"$cssClass\">" << pomo.shortDate(date: attrs.date) << "</span>"
}

def textToParagraphs = { attrs, body ->
out << "<p>" << body().trim().replaceAll(/(\s*\n)+/, "<p></p>") << "</p>"
}
}
3 changes: 1 addition & 2 deletions grails-app/views/task/_taskCard.gsp
@@ -1,7 +1,6 @@
<div class="task">
<h4>${ task.summary }</h4>
<p>${ task.details }</p>
<div><pomo:textToParagraphs>${ task.details }</pomo:textToParagraphs></div>
<div class="due">Due: <pomo:deadline date="${ task.deadline }"/></div>
<div class="created">Created: <pomo:shortDate date="${ task.dateCreated }"/></div>
</div>

0 comments on commit 6b41c1d

Please sign in to comment.