package com.samczsun.skype4j.formatting;

/**
 * Created by sam on 2015-07-09.
 */
public abstract class Text {
    public static final Text NEW_LINE = plain('\n');
    public static final Text BLANK = plain("");

    public abstract String write();

    public static RichText rich() {
        return new RichText();
    }

    public static PlainText plain(String text) {
        return new PlainText(text);
    }

    public static PlainText plain(byte text) {
        return plain(Integer.toString(text));
    }

    public static PlainText plain(char text) {
        return plain(String.valueOf(text));
    }

    public static PlainText plain(short text) {
        return plain(Integer.toString(text));
    }

    public static PlainText plain(double text) {
        return plain(Double.toString(text));
    }

    public static PlainText plain(float text) {
        return plain(Float.toString(text));
    }

    public static PlainText plain(int text) {
        return plain(Integer.toString(text));
    }

    public static PlainText plain(long text) {
        return plain(Long.toString(text));
    }

    public static PlainText plain(Object text) {
        return plain(text.toString());
    }

}

@@ -35,16 +35,68 @@
 tting;%0A%0A
+import org.apache.commons.lang3.StringEscapeUtils;%0A%0A
 /**%0A * C
@@ -448,21 +448,52 @@
 ainText(
+StringEscapeUtils.escapeHtml4(
 text)
+)
 ;%0A    %7D%0A
@@ -1283,10 +1283,103 @@
 %0A    %7D%0A%0A
+    public static PlainText rawHtml(String html) %7B%0A        return new PlainText(html);%0A    %7D%0A
 %7D%0A

Handle text creation properly. Fixes #18