Implementing Wiki part.

This commit is contained in:
takezoe
2013-05-02 02:32:19 +09:00
parent 1961a430c9
commit ea4d736931
4 changed files with 28 additions and 8 deletions

View File

@@ -18,6 +18,12 @@ object helpers {
def format(value: String): twirl.api.Html = twirl.api.Html(
value.replaceAll(" ", "&nbsp;").replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;").replaceAll("\n", "<br>"))
def markdown(value: String): twirl.api.Html = {
import org.pegdown._
val html = new PegDownProcessor().markdownToHtml(value)
twirl.api.Html(html)
}
/**
* Cut the given string by specified length.
*/