Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions js/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ function setupTextarea(el, opts)
}
});
});
return editor;
};


Expand Down
22 changes: 11 additions & 11 deletions js/run_examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// turns asserts into writeln
function reformatExample(code) {
return code.replace(/(<span class="d_keyword">assert<\/span>\((.*)==(.*)\);)+/g, function(match, text, left, right) {
return code.replace(/(<span class="(?:d_keyword|kwd)">assert<\/span>(?:<span class="pun">)?\((.*)==(.*)\);)+/g, function(match, text, left, right) {
return "writeln(" + left.trim() + "); "
+ "<span class='d_comment'>// " + right.trim() + "</span>";
});
Expand Down Expand Up @@ -90,15 +90,15 @@ $(document).ready(function()
var parent = $(this).parent();
var btnParent = parent.parent().children(".d_example_buttons");
var outputDiv = parent.parent().children(".d_code_output");
setupTextarea(this, {
parent: btnParent,
outputDiv: outputDiv,
stdin: false,
args: false,
transformOutput: wrapIntoMain,
defaultOutput: "All tests passed",
keepCode: true,
outputHeight: "auto"
});
var editor = setupTextarea(this, {
parent: btnParent,
outputDiv: outputDiv,
stdin: false,
args: false,
transformOutput: wrapIntoMain,
defaultOutput: "All tests passed",
keepCode: true,
outputHeight: "auto"
});
});
});