2 * put your module comment here
14 * Statische Hilfsmethoden zur Stringbehandlung
19 public final class StringUtil {
22 * Wandelt Datum in einen 8-ziffrigen String um (yyyymmdd)
24 * @return 8-ziffriger String (yyyymmdd)
27 public static final String date2webdbDate (GregorianCalendar theDate) {
28 StringBuffer webdbDate = new StringBuffer();
29 webdbDate.append(String.valueOf(theDate.get(Calendar.YEAR)));
30 webdbDate.append(pad2(theDate.get(Calendar.MONTH) + 1));
31 webdbDate.append(pad2(theDate.get(Calendar.DATE)));
32 return webdbDate.toString();
36 * wandelt Calendar in dd.mm.yyyy / hh.mm um
38 * @return String mit (dd.mm.yyyy / hh.mm um)
40 public static String date2readableDateTime (GregorianCalendar theDate) {
43 readable += pad2(theDate.get(Calendar.DATE));
44 readable += "." + pad2(theDate.get(Calendar.MONTH) + 1);
45 readable += "." + String.valueOf(theDate.get(Calendar.YEAR));
46 hour = theDate.get(Calendar.HOUR);
47 if (theDate.get(Calendar.AM_PM) == Calendar.PM)
49 readable += " / " + pad2(hour);
50 readable += ":" + pad2(theDate.get(Calendar.MINUTE));
55 * wandelt eine Datum in einen 8-buchstabigen String, der durch <code>/</code>
59 * @return String mit <code>/yyyy/mm/dd</code>
61 public static final String webdbDate2path (String webdbDate) {
62 StringBuffer path = new StringBuffer();
63 path.append("/").append(webdbDate.substring(0, 4));
64 path.append("/").append(webdbDate.substring(4, 6));
65 path.append("/").append(webdbDate.substring(6, 8));
66 return path.toString();
70 * wandelt Calendar in dd.mm.yyyy um
73 * @return String mit <code>dd.mm.yyyy</code>
75 public static final String webdbDate2readableDate (String webdbDate) {
77 date += webdbDate.substring(6, 8);
78 date += "." + webdbDate.substring(4, 6);
79 date += "." + webdbDate.substring(0, 4);
85 * converts string from format: yyyy-mm-dd__hh:mm:ss.d
88 public static String dateToReadableDate(String date) {
89 StringBuffer returnDate = new StringBuffer();
92 returnDate.append(date.substring(8,10)).append('.');
93 returnDate.append(date.substring(5,7)).append('.');
94 returnDate.append(date.substring(0,4)).append(' ');
95 returnDate.append(date.substring(11,16));
97 return returnDate.toString();
102 * schließt einen String in Anführungsszeichen ein, falls er Leerzeichen o.ä. enthält
104 * @return gequoteter String
106 public static String quoteIfNecessary(String s) {
107 for (int i = 0; i < s.length(); i++)
108 if (!(Character.isLetterOrDigit(s.charAt(i)) || s.charAt(i) == '.'))
109 return quote(s, '"');
114 * schließt <code>s</code> in <code>'</code> ein und setzt Backslashes vor
115 * "gefährliche" Zeichen innerhalb des Strings
116 * Quotes special SQL-characters in <code>s</code>
118 * @return geqoteter String
120 public static String quote(String s)
122 //String s2 = quote(s, '\'');
125 //Because of '?-Bug in Postgresql-JDBC-Driver
126 StringBuffer temp = new StringBuffer();
127 for(int i=0;i<s.length();i++){
128 if(s.charAt(i)=='\''){
129 temp.append("´");
131 temp.append(s.charAt(i));
134 String s2 = temp.toString();
137 s2 = quote(s2, '\"');
142 * schließt <code>s</code> in <code>'</code> ein und setzt Backslashes vor
143 * "gefährliche" Zeichen innerhalb des Strings
145 * @param s String, der gequoted werden soll
146 * @param quoteChar zu quotendes Zeichen
147 * @return gequoteter String
149 public static String quote(String s, char quoteChar)
151 StringBuffer buf = new StringBuffer(s.length());
153 while (pos < s.length()) {
154 int i = s.indexOf(quoteChar, pos);
155 if (i < 0) i = s.length();
156 buf.append(s.substring(pos, i));
158 if (pos < s.length()) {
160 buf.append(quoteChar);
164 return buf.toString();
168 * ersetzt gefährliche zeichen in <code>s</code>
172 public static String unquote(String s)
175 StringBuffer buf = new StringBuffer(s.length());
177 String searchString = "\\"+quoteChar;
178 while (pos < s.length()) {
179 int i = s.indexOf(searchString, pos);
180 if (i < 0) i = s.length();
181 buf.append(s.substring(pos, i));
184 return buf.toString();
188 * Wandelet String in byte[] um.
190 * @return byte[] des String
193 public static byte[] stringToBytes(String s) {
194 String crlf = System.getProperty("line.separator");
195 if (!crlf.equals("\n"))
196 s = replace(s, "\n", crlf);
197 // byte[] buf = new byte[s.length()];
198 byte[] buf = s.getBytes();
203 * Ersetzt in String <code>s</code> das <code>pattern</code> durch <code>substitute</code>
207 * @return String mit den Ersetzungen
209 public static String replace(String s, String pattern, String substitute) {
210 int i = 0, pLen = pattern.length(), sLen = substitute.length();
211 StringBuffer buf = new StringBuffer(s.length());
213 int j = s.indexOf(pattern, i);
215 buf.append(s.substring(i));
218 buf.append(s.substring(i, j));
219 buf.append(substitute);
223 return buf.toString();
228 * Fügt einen Separator an den Pfad an
230 * @return Pfad mit Separator am Ende
232 public static final String addSeparator (String path) {
233 return path.length() == 0 || path.endsWith(File.separator) ? path : path
234 + File.separatorChar;
238 * Fügt ein <code>/</code> ans ende des Strings and
240 * @return Pfad mit <code>/</code> am Ende
242 public static final String addSlash (String path) {
243 return path.length() == 0 || path.endsWith("/") ? path : path + '/';
247 * Löscht <code>/</code> am Ende des Strings, falls vorhanden
249 * @return String ohne <code>/</code> am Ende
251 public static final String removeSlash (String path) {
252 return path.length() > 1 && path.endsWith("/") ? path.substring(0, path.length()
257 * Löscht Slash am Anfang des Strings
261 public static String removeFirstSlash (String path) {
262 return path.startsWith("/") ? path.substring(1) : path;
266 * formatiert eine Zahl (0-99) zweistellig (z.B. 5 -> 05)
267 * @return zwistellige Zahl
269 public static String pad2 (int number) {
270 return number < 10 ? "0" + number : String.valueOf(number);
274 * formatiert eine Zahl (0-999) dreistellig (z.B. 7 -> 007)
276 * @return 3-stellige Zahl
278 public static String pad3 (int number) {
279 return number < 10 ? "00" + number : number < 100 ? "0" + number : String.valueOf(number);
283 * Konvertiert Unix-Linefeeds in Win-Linefeeds
285 * @return Konvertierter String
287 public static String unixLineFeedsToWin(String s) {
290 i = s.indexOf('\n', i+1);
292 if ((i == 0 || s.charAt(i-1) != '\r') &&
293 (i == s.length()-1 || s.charAt(i+1) != '\r')) {
294 s = s.substring(0, i)+'\r'+s.substring(i);
303 * verwandelt einen String in eine gültige Url, konvertiert Sonderzeichen
304 * und Spaces werden zu Underscores
306 * @return gültige Url
308 public static String convert2url(String s) {
310 StringBuffer buf = new StringBuffer();
311 for(int i = 0; i < s.length(); i++ ) {
312 switch( s.charAt( i ) ) {
314 buf.append( "oe" ); break;
316 buf.append( "ae" ); break;
318 buf.append( "ue" ); break;
320 buf.append( "a" ); break;
323 buf.append( "_" ); break;
325 if( buf.charAt( buf.length() - 1 ) != '_' ) {
330 buf.append( s.charAt( i ) );
333 return buf.toString();
337 * wandelt Sonderzeichen in Quotes um
339 * @return Kovertierter String
341 public static String encodeHtml(String s) {
342 StringBuffer buf = new StringBuffer();
343 for(int i=0;i < s.length(); i++ ) {
345 /** @todo looks inefficient */
346 if (s.charAt(i)=='&') {
347 // convert html to xml-parsable representation
348 if( s.indexOf( "ö", i ) == i ) {
349 buf.append( "ö" ); i += 5;
352 if( s.indexOf( "ä", i ) == i ) {
353 buf.append( "ä" ); i += 5;
356 if( s.indexOf( "ü", i ) == i ) {
357 buf.append( "ü" ); i += 5;
360 if( s.indexOf( "Ö", i ) == i ) {
361 buf.append( "Ö" ); i += 5;
364 if( s.indexOf( "Ä", i ) == i ) {
365 buf.append( "Ä" ); i += 5;
368 if( s.indexOf( "Ü", i ) == i ) {
369 buf.append( "Ü" ); i += 5;
372 if( s.indexOf( "ß", i ) == i ) {
373 buf.append( "ß" ); i += 6;
377 /** @todo should only escape outside of tags */
379 if( s.indexOf( """, i ) == i ) {
380 buf.append( "ß" ); i += 5;
383 if( s.indexOf( "–", i ) == i ) {
384 buf.append( "–" ); i += 6;
387 if( s.indexOf( "—", i ) == i ) {
388 buf.append( "—" ); i += 6;
391 if( s.indexOf( "“", i ) == i ) {
392 buf.append( "“" ); i += 6;
395 if( s.indexOf( "”", i ) == i ) {
396 buf.append( "”" ); i += 6;
399 if( s.indexOf( "„", i ) == i ) {
400 buf.append( "„" ); i += 6;
404 //looks pretty stupid
405 if( s.indexOf( "<", i ) == i ) {
406 buf.append( "<" ); i += 3;
409 if( s.indexOf( ">", i ) == i ) {
410 buf.append( ">" ); i += 3;
413 if( s.indexOf( "´", i ) == i ) {
414 buf.append( "´" ); i += 6;
417 if( s.indexOf( " ", i ) == i ) {
418 buf.append( " " ); i += 5;
422 if( s.indexOf( "&", i ) == i ) {
423 buf.append( "&" ); i += 0;
427 // convert umlauts an other special charakters
428 switch( s.charAt(i) ) {
429 case 'ö': buf.append( "ö" ); break;
430 case 'ä': buf.append( "ä" ); break;
431 case 'ü': buf.append( "ü" ); break;
432 case 'Ö': buf.append( "Ö" ); break;
433 case 'Ä': buf.append( "Ä" ); break;
434 case 'Ü': buf.append( "Ü" ); break;
435 case 'ß': buf.append( "ß" ); break;
436 case 'é': buf.append( "é" ); break;
437 case 'è': buf.append( "è" ); break;
438 case 'á': buf.append( "á" ); break;
439 case 'à': buf.append( "à" ); break;
440 case 'â': buf.append( "â" ); break;
441 case 'ã': buf.append( "ã" ); break;
442 case '¬': buf.append( "¬" ); break;
443 case '¹': buf.append( "¹" ); break;
444 case '²': buf.append( "²" ); break;
445 case '³': buf.append( "³" ); break;
446 case '¼': buf.append( "¼" ); break;
447 case '½': buf.append( "½" ); break;
448 case '¾': buf.append( "¾" ); break;
449 case '¶': buf.append( "¶" ); break;
450 case 'æ': buf.append( "æ" ); break;
451 case 'ð': buf.append( "ð" ); break;
452 case '|': buf.append( "¦" ); break;
453 case '·': buf.append( "·" ); break;
454 case '°': buf.append( "°" ); break;
455 case '§': buf.append( "§" ); break;
456 case 'ø': buf.append( "ø" ); break;
457 case 'ç': buf.append( "ç" ); break;
458 case '¤': buf.append( "¤" ); break;
459 case 'ª': buf.append( "ª" ); break;
460 case 'Ç': buf.append( "Ç" ); break;
461 case 'Ã': buf.append( "Ã" ); break;
462 case 'Â': buf.append( "Â" ); break;
463 case 'Æ': buf.append( "Æ" ); break;
464 case '©': buf.append( "©" ); break;
465 case '®': buf.append( "®" ); break;
466 case '¥': buf.append( "¥" ); break;
467 case 'Þ': buf.append( "þ" ); break;
468 case '¯': buf.append( "¯" ); break;
469 case 'Ð': buf.append( "Ð" ); break;
470 case 'º': buf.append( "º" ); break;
471 case '¡': buf.append( "¡" ); break;
472 case '£': buf.append( "£" ); break;
473 case '±': buf.append( "±" ); break;
474 case '¿': buf.append( "¿" ); break;
475 case 'Ø': buf.append( "Ø" ); break;
476 case 'Á': buf.append( "À" ); break;
477 case 'À': buf.append( "Á" ); break;
478 case 'É': buf.append( "È" ); break;
479 case 'È': buf.append( "É" ); break;
480 case 'ù': buf.append( "ú" ); break;
481 case 'ñ': buf.append( "ñ" ); break;
482 case 'Ñ': buf.append( "Ñ" ); break;
483 case 'µ': buf.append( "µ" ); break;
484 case 'Í': buf.append( "Ì" ); break;
485 case 'Ì': buf.append( "Í" ); break;
486 case 'í': buf.append( "ì" ); break;
487 case 'ì': buf.append( "í" ); break;
488 case 'î': buf.append( "î" ); break;
489 case 'Î': buf.append( "Î" ); break;
490 case 'ó': buf.append( "ó" ); break;
491 case 'Ó': buf.append( "Ò" ); break;
492 case 'ò': buf.append( "Î" ); break;
493 case 'Ò': buf.append( "Ó" ); break;
494 case 'ô': buf.append( "ô" ); break;
495 case 'Ô': buf.append( "Ô" ); break;
496 case 'õ': buf.append( "õ" ); break;
497 case 'Õ': buf.append( "Õ" ); break;
498 case 'ý': buf.append( "ý" ); break;
499 case 'Ý': buf.append( "Ý" ); break;
500 case 'û': buf.append( "û" ); break;
501 case 'Û': buf.append( "Û" ); break;
502 case 'ú': buf.append( "ù" ); break;
503 case 'Ú': buf.append( "Ù" ); break;
504 case 'Ù': buf.append( "Ú" ); break;
505 case 'Ê': buf.append( "Ê" ); break;
506 case 'ê': buf.append( "ê" ); break;
507 case 'å': buf.append( "å" ); break;
508 case 'Å': buf.append( "Å" ); break;
509 case 'ë': buf.append( "ë" ); break;
510 case 'Ë': buf.append( "Ë" ); break;
511 case 'ÿ': buf.append( "ÿ" ); break;
512 case 'ï': buf.append( "ï" ); break;
513 case 'Ï': buf.append( "Ï" ); break;
514 case '«': buf.append( "«" ); break;
515 case '»': buf.append( "»" ); break;
516 case '\'': buf.append( "´" ); break;
517 case '\"': buf.append( """ ); break;
518 //case '\u8211': buf.append( "–" ); break;
519 //case '\u8212': buf.append( "—" ); break;
520 //case '\u8220': buf.append( "“" ); break;
521 //case '\u8221': buf.append( "”" ); break;
522 //case '\u8222': buf.append( "„" ); break;
523 //case '\"': buf.append( """ ); break;
524 default: buf.append( s.charAt(i) );
528 return buf.toString();
532 public static String decodeHTMLinTags(String s){
533 StringBuffer buffer = new StringBuffer();
534 boolean start = false;
535 boolean stop = false;
540 for(int i=0;i<s.length();i++){
541 if(s.charAt(i)=='<'){
544 } else if(s.charAt(i)=='>'){
549 buffer.append(s.substring(temp,startIndex));
550 buffer.append(replaceQuot(s.substring(startIndex,stopIndex+1)));
551 i= temp= stopIndex+1;
556 buffer.append(s.substring(stopIndex+1));
557 return buffer.toString();
560 public static String replaceQuot(String s) {
561 StringBuffer buffer = new StringBuffer();
562 for(int j = 0; j < s.length();j++){
563 if(s.charAt(j)=='&'){
564 if(s.indexOf( """,j) == j) {
565 buffer.append( "\"" );
569 buffer.append(s.charAt(j));
572 return buffer.toString();
575 /** wandelt Quotes in Sonderzeichen um
577 public static String decodeHtml(String s) {
578 StringBuffer buf = new StringBuffer();
579 for(int i=0;i < s.length(); i++ ) {
580 if( s.indexOf( "ö", i ) == i ) {
581 buf.append( "ö" ); i += 5;
584 if( s.indexOf( "ä", i ) == i ) {
585 buf.append( "ä" ); i += 5;
588 if( s.indexOf( "ü", i ) == i ) {
589 buf.append( "ü" ); i += 5;
592 if( s.indexOf( "Ö", i ) == i ) {
593 buf.append( "Ö" ); i += 5;
596 if( s.indexOf( "Ä", i ) == i ) {
597 buf.append( "Ä" ); i += 5;
600 if( s.indexOf( "Ü", i ) == i ) {
601 buf.append( "Ü" ); i += 5;
604 if( s.indexOf( "ß", i ) == i ) {
605 buf.append( "ß" ); i += 6;
608 if( s.indexOf( """, i ) == i ) {
609 buf.append( "\"" ); i += 5;
612 buf.append( s.charAt(i) );
614 return buf.toString();
619 * schnellere Variante der String.toLowerCase()-Routine
621 * @return String in Kleinbuchsten
623 public static String toLowerCase(String s) {
625 char[] a = new char[l];
626 for (int i = 0; i < l; i++)
627 a[i] = Character.toLowerCase(s.charAt(i));
628 return new String(a);
632 * Findet <code>element</code> im String-Array <code>array</code>
635 * @return Fundstelle als int oder -1
637 public static int indexOf(String[] array, String element) {
639 for (int i = 0; i < array.length; i++)
640 if (array[i].equals(element))
646 * Testet auf Vorkommen von <code>element</code> in <code>array</code>
647 * @param array String-Array
649 * @return true wenn <code>element</code> vorkommt, sonst false
651 public static boolean contains(String[] array, String element) {
652 return indexOf(array, element) >= 0;
656 * Ermittelt CRC-Prüfsumme von String <code>s</code>
658 * @return CRC-Prüfsumme
660 public static int getCRC(String s) {
662 char val[] = s.toCharArray();
663 int len = val.length;
665 for (int i = 0 ; i < len; i++) {
667 h = (((h >> 30) | (h << 1)) ^ (val[i]+i));
670 return (h << 8) | (len & 0xff);
674 * Liefert Default-Wert def zurück, wenn String <code>s</code>
679 * @return geparster int aus s oder def
681 public static int parseInt(String s, int def) {
682 if (s == null) return def;
684 return Integer.parseInt(s);
685 } catch (NumberFormatException e) {
691 * Liefert Defaultwert def zurück, wenn s nicht zu einem float geparsed werden kann.
694 * @return geparster float oder def
696 public static float parseFloat(String s, float def) {
697 if (s == null) return def;
699 return new Float(s).floatValue();
700 } catch (NumberFormatException e) {
706 * Findet Ende eines Satzes in String <code>text</code>
709 * @return index des Satzendes, oder -1
711 public static int findEndOfSentence(String text, int startIndex) {
713 int i = text.indexOf('.', startIndex);
714 if (i < 0) return -1;
715 if (i > 0 && !Character.isDigit(text.charAt(i-1)) &&
716 (i+1 >= text.length()
717 || text.charAt(i+1) == ' '
718 || text.charAt(i+1) == '\n'
719 || text.charAt(i+1) == '\t'))
726 * Findet Wortende in String <code>text</code> ab <code>startIndex</code>
729 * @return Index des Wortendes, oder -1
731 public static int findEndOfWord(String text, int startIndex) {
732 int i = text.indexOf(' ', startIndex),
733 j = text.indexOf('\n', startIndex);
734 if (i < 0) i = text.length();
735 if (j < 0) j = text.length();
736 return Math.min(i, j);
740 * Diese Routine macht aus links in reinem text browsbare links
742 * @return Konvertierter String
744 public static String makeLinks(String text) {
746 StringBuffer buf = new StringBuffer(text.length());
748 int j = text.indexOf("http://", i);
750 buf.append(text.substring(i));
753 buf.append(text.substring(i, j));
754 int k = findEndOfWord(text,j+7);
756 if (k<0) url = text.substring(j);
757 else url = text.substring(j,k);
759 buf.append("<a href=\042"+url+"\042>"+url+"</a>");
760 //System.out.println("url mark: " + url);
764 return buf.toString();
770 * convertNewline2P ist eine regex-routine zum umwandeln von 2 oder mehr newlines (\n)
771 * in den html-tag <p>
772 * nur sinnvoll, wenn text nicht im html-format eingegeben
774 public static String convertNewline2P(String haystack) {
776 RE regex = new RE("(<br>\r?\n<br>){1,}");
777 return regex.substituteAll(haystack,"\n</p><p>");
778 } catch(REException ex){
784 * convertNewline2Break ist eine regex-routine zum umwandeln von 1 newline (\n)
785 * in den html-tag <br>
786 * nur sinnvoll, wenn text nicht im html-format eingegeben
788 public static String convertNewline2Break(String haystack) {
790 RE regex = new RE("(\r?\n){1}");
791 return regex.substituteAll(haystack,"$0<br>");
792 } catch(REException ex){
798 * createMailLinks wandelt text im email-adressenformat
799 * in einen klickbaren link um
800 * nur sinnvoll, wenn text nicht im html-format eingegeben
802 public static String createMailLinks(String haystack) {
804 RE regex = new RE("([a-zA-Z0-9_.-]+)@([a-zA-Z0-9_-]+).([a-zA-Z0-9_.-]+)");
805 return regex.substituteAll(haystack,"<a href=\"mailto:$0\">$0</a>");
806 } catch(REException ex){
813 * createMailLinks wandelt text im email-adressenformat
814 * in einen klickbaren link um
815 * nur sinnvoll, wenn text nicht im html-format eingegeben
817 public static String createMailLinks(String haystack, String imageRoot, String mailImage) {
819 RE regex = new RE("([a-zA-Z0-9_.-]+)@([a-zA-Z0-9_-]+).([a-zA-Z0-9_.-]+)");
820 return regex.substituteAll(haystack,"<img src=\""+imageRoot+"/"+mailImage+"\" border=\"0\"/> <a href=\"mailto:$0\">$0</a>");
821 } catch(REException ex){
828 * createURLLinks wandelt text im url-format
829 * in einen klickbaren link um
830 * nur sinnvoll, wenn text nicht im html-format eingegeben
832 public static String createURLLinks(String haystack) {
834 //dieser Ausdruck brauch dringend fachliche Beratung
835 RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/([^ \t\r\n<>]+[^ \t\r\n.,<>])");
836 return regex.substituteAll(haystack,"<a href=\"$0\">$0</a>");
837 } catch(REException ex){
843 * createURLLinks wandelt text im url-format
844 * in einen klickbaren link um
845 * nur sinnvoll, wenn text nicht im html-format eingegeben
847 public static String createURLLinks(String haystack,String imageRoot,String extImage,String intImage) {
849 //dieser Ausdruck brauch dringend fachliche Beratung
850 RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>]+[^ \t\r\n.,<>])");
851 return regex.substituteAll(haystack,"<img src=\""+imageRoot+"/"+extImage+"\" border=\"0\"/> <a href=\"$0\">$0</a>");
852 } catch(REException ex){
858 * deleteForbiddenTags
859 * this method deletes all <script>, <body> and <head>-tags
861 public static String deleteForbiddenTags(String haystack) {
863 RE regex = new RE("<[ \t\r\n](.*?)script(.*?)/script(.*?)>",RE.REG_ICASE);
864 haystack = regex.substituteAll(haystack,"");
865 regex = new RE("<head>(.*?)</head>");
866 haystack = regex.substituteAll(haystack,"");
867 regex = new RE("<[ \t\r\n/]*body(.*?)>");
868 haystack = regex.substituteAll(haystack,"");
870 } catch(REException ex){
876 * createHTML ruft alle regex-methoden zum unwandeln eines nicht
877 * htmlcodierten string auf und returnt einen htmlcodierten String
879 public static String createHTML(String content){
880 content=convertNewline2Break(content);
881 content=convertNewline2P(content);
882 content=createMailLinks(content);
883 content=createURLLinks(content);
888 * createHTML ruft alle regex-methoden zum unwandeln eines nicht
889 * htmlcodierten string auf und returnt einen htmlcodierten String
891 public static String createHTML(String content,String producerDocRoot,String mailImage,String extImage,String intImage){
892 content=convertNewline2Break(content);
893 content=convertNewline2P(content);
894 content=createMailLinks(content,producerDocRoot,mailImage);
895 content=createURLLinks(content,producerDocRoot,extImage,intImage);