diff --git a/src/java/com/samskivert/servlet/util/HTMLUtil.java b/src/java/com/samskivert/servlet/util/HTMLUtil.java
index d30706b7..a018cb0f 100644
--- a/src/java/com/samskivert/servlet/util/HTMLUtil.java
+++ b/src/java/com/samskivert/servlet/util/HTMLUtil.java
@@ -90,20 +90,37 @@ public class HTMLUtil
*/
public static String simpleFormat (String text)
{
- String[] lines = StringUtil.split(text, "\n");
- StringBuilder tbuf = new StringBuilder();
+ // first replace the image and other URLs
+ Matcher m = _url.matcher(text);
+ StringBuffer tbuf = new StringBuffer();
+ while (m.find()) {
+ String match = m.group();
+ String lmatch = match.toLowerCase();
+ if (lmatch.endsWith(".png") ||
+ lmatch.endsWith(".jpg") ||
+ lmatch.endsWith(".gif")) {
+ match = "";
+ } else {
+ match = "" + match + "";
+ }
+ m.appendReplacement(tbuf, match);
+ }
+ m.appendTail(tbuf);
+
+ // then do our paragraph and list processing
+ String[] lines = StringUtil.split(tbuf.toString(), "\n");
+ StringBuilder lbuf = new StringBuilder();
boolean inpara = false, inlist = false;
-
for (int ii = 0; ii < lines.length; ii++) {
String line = lines[ii];
if (StringUtil.isBlank(lines[ii])) {
if (inlist) {
- tbuf.append("");
+ lbuf.append("");
inlist = false;
}
if (inpara) {
- tbuf.append("
"); + lbuf.append("
"); } if (line.startsWith("*")) { if (inlist) { - tbuf.append("