benmills/robotskirt — Issue #9: Problem with toHtmlSync()
Author: rafeca
Created: 2011-12-04 18:35:15+00:00
State: open

When I call sequentially several times the method `toHtmlSync()`, sometimes I get unexpected results.

As a proof of example, the following script:

```js
var output;
for (var i=0;i<1000;i++) {
output = markdown.toHtmlSync('*sync!*').toString();

if (output !== '

sync!

\n') {
console.log('Fails!');
}
}
```

Will print 'Fails' several times.

When I parse more complicated strings (for example full files), I got unexpected results almost always:

```js
var output = {};
['README.md', 'History.md', 'Authors.md'].forEach(function(file) {
output[file] = markdown.toHtmlSync(
fs.readFileSync(path.join(options.currentPath, file), 'utf8')
).toString();
}
```

I'm currently using Node.js 0.6.4 and robotskirt 0.2.4 under OSX