Răsfoiți Sursa

add HtmlText.defaultFormatText

trethaller 5 ani în urmă
părinte
comite
64dcb5c5e7
1 a modificat fișierele cu 11 adăugiri și 0 ștergeri
  1. 11 0
      h2d/HtmlText.hx

+ 11 - 0
h2d/HtmlText.hx

@@ -33,6 +33,13 @@ class HtmlText extends Text {
 		return null;
 	}
 
+	/**
+		A default method HtmlText uses to format assigned text.
+	**/
+	public static dynamic function defaultFormatText( text : String ) : String {
+		return null;
+	}
+
 	public var condenseWhite(default,set) : Bool = true;
 
 	/**
@@ -96,6 +103,10 @@ class HtmlText extends Text {
 		else return f;
 	}
 
+	public dynamic function formatText( text : String ) : String {
+		return defaultFormatText(text);
+	}
+
 	function parseText( text : String ) {
 		return try Xml.parse(text) catch( e : Dynamic ) throw "Could not parse " + text + " (" + e +")";
 	}