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
578 public static String decodeHtml(String s) {
579 StringBuffer buf = new StringBuffer();
580 for(int i=0;i < s.length(); i++ ) {
581 if( s.indexOf( "ö", i ) == i ) {
582 buf.append( "ö" ); i += 5;
585 if( s.indexOf( "ä", i ) == i ) {
586 buf.append( "ä" ); i += 5;
589 if( s.indexOf( "ü", i ) == i ) {
590 buf.append( "ü" ); i += 5;
593 if( s.indexOf( "Ö", i ) == i ) {
594 buf.append( "Ö" ); i += 5;
597 if( s.indexOf( "Ä", i ) == i ) {
598 buf.append( "Ä" ); i += 5;
601 if( s.indexOf( "Ü", i ) == i ) {
602 buf.append( "Ü" ); i += 5;
605 if( s.indexOf( "ß", i ) == i ) {
606 buf.append( "ß" ); i += 6;
609 if( s.indexOf( """, i ) == i ) {
610 buf.append( "\"" ); i += 5;
613 buf.append( s.charAt(i) );
615 return buf.toString();
620 * schnellere Variante der String.toLowerCase()-Routine
622 * @return String in Kleinbuchsten
624 public static String toLowerCase(String s) {
626 char[] a = new char[l];
627 for (int i = 0; i < l; i++)
628 a[i] = Character.toLowerCase(s.charAt(i));
629 return new String(a);
633 * Findet <code>element</code> im String-Array <code>array</code>
636 * @return Fundstelle als int oder -1
638 public static int indexOf(String[] array, String element) {
640 for (int i = 0; i < array.length; i++)
641 if (array[i].equals(element))
647 * Testet auf Vorkommen von <code>element</code> in <code>array</code>
648 * @param array String-Array
650 * @return true wenn <code>element</code> vorkommt, sonst false
652 public static boolean contains(String[] array, String element) {
653 return indexOf(array, element) >= 0;
657 * Ermittelt CRC-Prüfsumme von String <code>s</code>
659 * @return CRC-Prüfsumme
661 public static int getCRC(String s) {
663 char val[] = s.toCharArray();
664 int len = val.length;
666 for (int i = 0 ; i < len; i++) {
668 h = (((h >> 30) | (h << 1)) ^ (val[i]+i));
671 return (h << 8) | (len & 0xff);
675 * Liefert Default-Wert def zurück, wenn String <code>s</code>
680 * @return geparster int aus s oder def
682 public static int parseInt(String s, int def) {
683 if (s == null) return def;
685 return Integer.parseInt(s);
686 } catch (NumberFormatException e) {
692 * Liefert Defaultwert def zurück, wenn s nicht zu einem float geparsed werden kann.
695 * @return geparster float oder def
697 public static float parseFloat(String s, float def) {
698 if (s == null) return def;
700 return new Float(s).floatValue();
701 } catch (NumberFormatException e) {
707 * Findet Ende eines Satzes in String <code>text</code>
710 * @return index des Satzendes, oder -1
712 public static int findEndOfSentence(String text, int startIndex) {
714 int i = text.indexOf('.', startIndex);
715 if (i < 0) return -1;
716 if (i > 0 && !Character.isDigit(text.charAt(i-1)) &&
717 (i+1 >= text.length()
718 || text.charAt(i+1) == ' '
719 || text.charAt(i+1) == '\n'
720 || text.charAt(i+1) == '\t'))
727 * Findet Wortende in String <code>text</code> ab <code>startIndex</code>
730 * @return Index des Wortendes, oder -1
732 public static int findEndOfWord(String text, int startIndex) {
733 int i = text.indexOf(' ', startIndex),
734 j = text.indexOf('\n', startIndex);
735 if (i < 0) i = text.length();
736 if (j < 0) j = text.length();
737 return Math.min(i, j);
741 * Diese Routine macht aus links in reinem text browsbare links
743 * @return Konvertierter String
745 public static String makeLinks(String text) {
747 StringBuffer buf = new StringBuffer(text.length());
749 int j = text.indexOf("http://", i);
751 buf.append(text.substring(i));
754 buf.append(text.substring(i, j));
755 int k = findEndOfWord(text,j+7);
757 if (k<0) url = text.substring(j);
758 else url = text.substring(j,k);
760 buf.append("<a href=\042"+url+"\042>"+url+"</a>");
761 //System.out.println("url mark: " + url);
765 return buf.toString();
771 * convertNewline2P ist eine regex-routine zum umwandeln von 2 oder mehr newlines (\n)
772 * in den html-tag <p>
773 * nur sinnvoll, wenn text nicht im html-format eingegeben
775 public static String convertNewline2P(String haystack) {
777 RE regex = new RE("(<br>\r?\n<br>){1,}");
778 return regex.substituteAll(haystack,"\n</p><p>");
779 } catch(REException ex){
785 * convertNewline2Break ist eine regex-routine zum umwandeln von 1 newline (\n)
786 * in den html-tag <br>
787 * nur sinnvoll, wenn text nicht im html-format eingegeben
789 public static String convertNewline2Break(String haystack) {
791 RE regex = new RE("(\r?\n){1}");
792 return regex.substituteAll(haystack,"$0<br>");
793 } catch(REException ex){
799 * createMailLinks wandelt text im email-adressenformat
800 * in einen klickbaren link um
801 * nur sinnvoll, wenn text nicht im html-format eingegeben
803 public static String createMailLinks(String haystack) {
805 RE regex = new RE("([a-zA-Z0-9_.-]+)@([a-zA-Z0-9_-]+).([a-zA-Z0-9_.-]+)");
806 return regex.substituteAll(haystack,"<a href=\"mailto:$0\">$0</a>");
807 } catch(REException ex){
814 * createMailLinks wandelt text im email-adressenformat
815 * in einen klickbaren link um
816 * nur sinnvoll, wenn text nicht im html-format eingegeben
818 public static String createMailLinks(String haystack, String imageRoot, String mailImage) {
820 RE regex = new RE("([a-zA-Z0-9_.-]+)@([a-zA-Z0-9_-]+).([a-zA-Z0-9_.-]+)");
821 return regex.substituteAll(haystack,"<img src=\""+imageRoot+"/"+mailImage+"\" border=\"0\"/> <a href=\"mailto:$0\">$0</a>");
822 } catch(REException ex){
829 * createURLLinks wandelt text im url-format
830 * in einen klickbaren link um
831 * nur sinnvoll, wenn text nicht im html-format eingegeben
833 public static String createURLLinks(String haystack) {
835 //dieser Ausdruck brauch dringend fachliche Beratung
836 RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/([^ \t\r\n<>]+[^ \t\r\n.,<>])");
837 return regex.substituteAll(haystack,"<a href=\"$0\">$0</a>");
838 } catch(REException ex){
844 * createURLLinks wandelt text im url-format
845 * in einen klickbaren link um
846 * nur sinnvoll, wenn text nicht im html-format eingegeben
848 public static String createURLLinks(String haystack,String imageRoot,String extImage,String intImage) {
850 //dieser Ausdruck brauch dringend fachliche Beratung
851 RE regex = new RE("((https://)|(http://)|(ftp://))+([a-zA-Z0-9_-]+).([a-zA-Z0-9_.:-]+)/?([^ \t\r\n<>]+[^ \t\r\n.,<>])");
852 return regex.substituteAll(haystack,"<img src=\""+imageRoot+"/"+extImage+"\" border=\"0\"/> <a href=\"$0\">$0</a>");
853 } catch(REException ex){
859 * deleteForbiddenTags
860 * this method deletes all <script>, <body> and <head>-tags
862 public static String deleteForbiddenTags(String haystack) {
864 RE regex = new RE("<[ \t\r\n](.*?)script(.*?)/script(.*?)>",RE.REG_ICASE);
865 haystack = regex.substituteAll(haystack,"");
866 regex = new RE("<head>(.*?)</head>");
867 haystack = regex.substituteAll(haystack,"");
868 regex = new RE("<[ \t\r\n/]*body(.*?)>");
869 haystack = regex.substituteAll(haystack,"");
871 } catch(REException ex){
877 * createHTML ruft alle regex-methoden zum unwandeln eines nicht
878 * htmlcodierten string auf und returnt einen htmlcodierten String
880 public static String createHTML(String content){
881 content=convertNewline2Break(content);
882 content=convertNewline2P(content);
883 content=createMailLinks(content);
884 content=createURLLinks(content);
889 * createHTML ruft alle regex-methoden zum unwandeln eines nicht
890 * htmlcodierten string auf und returnt einen htmlcodierten String
892 public static String createHTML(String content,String producerDocRoot,String mailImage,String extImage,String intImage){
893 content=convertNewline2Break(content);
894 content=convertNewline2P(content);
895 content=createMailLinks(content,producerDocRoot,mailImage);
896 content=createURLLinks(content,producerDocRoot,extImage,intImage);