Kawai Wiki

Rev

Rev 194 | Rev 198 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 194 Rev 195
Line 14... Line 14...
14
 *
14
 *
15
 */
15
 */
16
public class Code implements KCode {
16
public class Code implements KCode {
17
17
18
        /**
18
    /**
19
     * {@inheritDoc}
19
     * {@inheritDoc}.
20
     */
20
     */
21
    @Override
21
    @Override
22
    public boolean hasBody() {
22
    public boolean hasBody() {
23
        return true;
23
        return true;
24
    }
24
    }
Line 52... Line 52...
52
        if (indent) sb.append("</ul>");
52
        if (indent) sb.append("</ul>");
53
        sb.append("<br/>");
53
        sb.append("<br/>");
54
        return sb.toString();
54
        return sb.toString();
55
    }
55
    }
56
56
-
 
57
    /**
-
 
58
     * Escapes the angle brackets.
-
 
59
     * @param html String
-
 
60
     * @return String
-
 
61
     */
57
    private String escapeAngleBrackets(String html) {
62
    private String escapeAngleBrackets(String html) {
58
        String s = Regex.sub(html, "s/\\</\\&lt\\;/g");
63
        String s = Regex.sub(html, "s/\\</\\&lt\\;/g");
59
        s = Regex.sub(s, "s/\\>/\\&gt\\;/g");
64
        s = Regex.sub(s, "s/\\>/\\&gt\\;/g");
60
        return s;
65
        return s;
61
    }
66
    }
62
67
-
 
68
    /**
-
 
69
     * Builds the tag for syntax highlight.
-
 
70
     * @param map Map<String, String>
-
 
71
     * @return String
-
 
72
     */
63
    private static String buildOpenShTag(Map<String, String> map) {
73
    private static String buildOpenShTag(Map<String, String> map) {
64
        StringBuilder sb = new StringBuilder(256);
74
        StringBuilder sb = new StringBuilder(256);
65
        sb.append("<pre class=\"");
75
        sb.append("<pre class=\"");
66
        if (map.containsKey("brush")) {
76
        if (map.containsKey("brush")) {
67
            sb.append("brush: ").append(map.get("brush")).append(";");
77
            sb.append("brush: ").append(map.get("brush")).append(";");