INNER CODE UNIT · JavaScript

nl2br

t3l3machus/toxssin · toxin.js:5

function nl2br(txt) {
	return txt.replace(/(\r\n|\n|\r)/gm, '<%LineBreak>');
};


function urlencodeFormData(fd) {
	
    var s = '';
    function encode(s){ return encodeURIComponent(s).replace(/%20/g,'+'); }
    
    for (var pair of fd.entries()) {
        if (typeof pair[1] == 'string') {
            s += (s?'&':'') + encode(pair[0]) + '=' + encode(pair[1]);
        }
    }
    return s;
};

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…