Skip to content

Commit

Permalink
fix snippet sandboxed execution. tested in both Mac and Windows
Browse files Browse the repository at this point in the history
fix snippet regex to work on windows \r\n (for win) \n (for *nix)
  • Loading branch information
woloski committed Jan 6, 2012
1 parent f74d8c2 commit c9740d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/wheat/data.js
Expand Up @@ -2,7 +2,7 @@ var Git = require('git-fs'),
Path = require('path'),
Step = require('step'),
util = require(process.binding('natives').util ? 'util' : 'sys'),
Script = process.binding('evals').Script,
Script = require('vm'),
QueryString = require('querystring');

function preProcessMarkdown(markdown) {
Expand All @@ -23,10 +23,10 @@ function preProcessMarkdown(markdown) {

// Look for snippet placeholders
var unique = props.uniqueSnippets = {};
props.snippets = (markdown.match(/\n<[^<>:\s]+\.[a-z]{2,4}(\*|[#].+)?>\n/g) || []).map(
props.snippets = (markdown.match(/(\r\n|\n)<[^<>:\s]+\.[a-z]{2,4}(\*|[#].+)?>(\r\n|\n)/g) || []).map(
function (original) {
var path = original.substr(2, original.length - 4);

var path = original.slice(original.indexOf("<")+1, original.indexOf(">"));
var filename = path;
execute = path[path.length - 1] === "*";
if (execute) {
Expand Down

0 comments on commit c9740d9

Please sign in to comment.