New utility function.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1002 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2002-12-30 04:52:36 +00:00
parent c91b6c6482
commit 574c1ac8bc
@@ -1,5 +1,5 @@
//
// $Id: HTMLUtil.java,v 1.1 2001/10/31 09:44:22 mdb Exp $
// $Id: HTMLUtil.java,v 1.2 2002/12/30 04:52:36 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -44,4 +44,15 @@ public class HTMLUtil
text = StringUtil.replace(text, ">", ">");
return StringUtil.replace(text, "\"", """);
}
/**
* Inserts a <p> tag between every two consecutive newlines.
*/
public static String makeParagraphs (String text)
{
if (text == null) {
return text;
}
return StringUtil.replace(text, "\n\n", "\n<p>\n");
}
}