Skip to content
Snippets Groups Projects
Commit 4d24338a authored by deuce's avatar deuce
Browse files

Escape @, ^, and % in replacements until done parsing.

parent 34189043
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ function write_template(filename) {
return(ret);
});
file=parse_regular_bit(file, "", template);
file=file.replace(/\<\!-- Magical Synchronet ([\^%@])-code --\>/g,'$1');
write(file);
}
......@@ -84,10 +85,14 @@ function parse_regular_bit(bit, objname, obj) {
function escape_match(start, exp, end) {
if(exp==undefined)
exp='';
exp=exp.toString();
if(start=="%")
exp=html_encode(exp,false,false,false,false);
if(start=="^")
exp=encodeURIComponent(exp);
exp=exp.replace(/\@/g,'<!-- Magical Synchronet @-code -->');
exp=exp.replace(/\^/g,'<!-- Magical Synchronet ^-code -->');
exp=exp.replace(/\%/g,'<!-- Magical Synchronet %-code -->');
return(exp);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment