1function p2br(str) { 2 // Wandelt <p>FooBar</p> in FooBar<BR> um 3 // <BR> am Ende innerhalb eines <P>-Blocks (2* neue Zeile) -> einfaches <BR> 4 var i, matches, m, str; 5 matches = str.match(/<BR>\s*<\/P>/ig); 6 for (i in matches) { 7 if (isNaN(i)) continue; 8 m = matches[i].toString(); 9 str = replacer(m, "<BR>", str); 10 } 11 12 var placeholder = "<PTOBR>" 13 14 str = replacer("</p>", placeholder, str); 15 str = replacer("</P>", placeholder, str); 16 str = replacer("<p>", "", str); 17 str = replacer("<P>", "", str); 18 19 if ( str.slice( -1 * placeholder.length ) == placeholder ) { 20 str = str.substring( 0, str.length - placeholder.length ) 21 } 22 23 str = replacer("<PTOBR>", "<br>", str); 24 return str; 25} 26 27function replacer(search, replace, str) { 28 // str.replace ersetzt nur 1x. Hier wird alles ersetzt 29 return str.split(search).join(replace); 30}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.