new Implementation and basic bbCode(Ok, opnly one Command ...)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@343 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 20 years ago
parent a60f5efcd6
commit 82d78fdab7

@ -41,25 +41,24 @@
/**Some code to avoid people being able to mess with the message system
*by using HTML.
*@author Marc Nause
extended for bbCode by Alexander Schier
*/
package de.anomic.tools;
public class unHtml {
public class bbCode {
String text;
/**Creates an object so un() has something to work on*/
public unHtml(String s)
/**init - no Code yet*/
public bbCode()
{
this.text = s;
}
/**Replaces all < and > with &lt; and &gt in a string.
/**Replaces all < and > with &lt; and &gt; in a string.
*@author Marc Nause
*@return String
*/
public String un(){
String input = this.text;
public String escapeHtml(String input){
String output = "";
int iter = 0;
@ -73,4 +72,16 @@ public class unHtml {
return output;
}
}
/**Parses parts of bbCode (will be extended).
*@author Alexander Schier
*@return String
*/
public String bb(String input){
String output = escapeHtml(input);
output = output.replaceAll("\\[b\\]", "<b>");
output = output.replaceAll("\\[/b\\]", "</b>");
return output;
}
}

Loading…
Cancel
Save