markdown-js
markdown-js copied to clipboard
eat 100% CPU for specific text.
parse following text file(a.md) eat 100% cpu:
```
- (void)handleOrientation:(NSNotification *)notification
{
switch (currentOrientation) {
case UIInterfaceOrientationPortrait:
rotation = 0;
break;
case UIInterfaceOrientationPortraitUpsideDown:
rotation = M_PI;
break;
case UIInterfaceOrientationLandscapeLeft:
rotation = -M_PI_2;
break;
case UIInterfaceOrientationLandscapeRight:
rotation = M_PI_2;
break;
}
}
```
Code:
var s = require("fs").readFileSync('./a.md');
require("markdown").markdown.toHTML(s.toString());
:+1: Confirmed.
Also i cannot do multi-line block of code?