Kawai Wiki

Compare Revisions

Ignore whitespace Rev 94 → Rev 95

/trunk/src/main/java/org/kawai/tag/kcode/Code.java
5,6 → 5,8
 
import javax.servlet.jsp.PageContext;
 
import org.mentaregex.Regex;
 
public class Code implements KCode {
@Override
30,12 → 32,18
 
if (indent) sb.append("<ul>");
sb.append(buildOpenShTag(attrs));
sb.append(html);
sb.append(escapeAngleBrackets(html));
sb.append("</pre>");
if (indent) sb.append("</ul>");
return sb.toString();
}
private String escapeAngleBrackets(String html) {
String s = Regex.sub(html, "s/\\</\\&lt\\;/g");
s = Regex.sub(s, "s/\\>/\\&gt\\;/g");
return s;
}
private static String buildOpenShTag(Map<String, String> map) {
StringBuilder sb = new StringBuilder(256);
sb.append("<pre class=\"");