New utility function.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1002 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -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
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -44,4 +44,15 @@ public class HTMLUtil
|
|||||||
text = StringUtil.replace(text, ">", ">");
|
text = StringUtil.replace(text, ">", ">");
|
||||||
return 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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user