Skip to content
Snippets Groups Projects
Commit 7d2f5a0a authored by deuce's avatar deuce
Browse files

Fix formatting.

Allow <?xjs to be at the end of a line without a trailing space.
Allow short tags ala PHP... ie: <? some code here ?>
parent 758bd8ab
No related branches found
No related tags found
No related merge requests found
...@@ -34,13 +34,18 @@ if(!file_exists(ssjs_filename)) { ...@@ -34,13 +34,18 @@ if(!file_exists(ssjs_filename)) {
var str=text[line]; var str=text[line];
while(str != '') { while(str != '') {
if(!in_xjs) { if(!in_xjs) {
if(str.search(/<\?xjs\s+/)==-1) { if(str=='<?xjs' || str=='<?') {
in_xjs=true;
str='';
}
else {
if(str.search(/<\?(xjs)?\s+/)==-1) {
script += "writeln("+escape_quotes(str)+");\r\n"; script += "writeln("+escape_quotes(str)+");\r\n";
str=''; str='';
} }
else { else {
str=str.replace(/^(.*?)<\?xjs\s+/, str=str.replace(/^(.*?)<\?(xjs)?\s+/,
function (str, p1, offset, s) { function (str, p1, p2, offset, s) {
script += "write("+escape_quotes(p1)+");\r\n"; script += "write("+escape_quotes(p1)+");\r\n";
in_xjs=true; in_xjs=true;
return ''; return '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment