jsdoc3/jsdoc — pull request #223 by matthewkastor (2012-10-15 19:33:53+00:00)
Title: Filtering EOL marks on input markdown

Since the evilstreak/markdown plugin expects files to use \n as the EOL
mark, and chokes to death on \r\n, I've added filters everywhere that
evilstreak is run.

Everywhere I added the filter I added an identical comment. `// filters EOL of source so evilstreak/markdown doesn't screw the pooch.` So if we
wanted to wire up some system module or whatever, we could find the
alterations I made today and replace them with calls to some function
like:

```javascript
/**
* Converts end of line markers into whatever you want.
* Automatically detects any of \r\n, \n, or \r and
* replaces it with the user specified EOL marker.
* @param {String} text The text you want processed.
* @param {String} newEOL The replacement for the current EOL marks.
* @returns {String} Returns the processed text.
*/
function convertEOL(text, newEOL) {
return text.replace(/(\r\n|\n|\r)/g, newEOL);
}
```

While it would be easier to modify the evilstreak/markdown.js itself,
I'm avoiding doing so because we'd have to re-mod it if the upstream
resource is improved and we want to use it.

I moved plugins/markdown.md into plugins/tutorials/markdown.md so that
if/when we want to use JSDoc to generate documentation for the code in
the plugins folder, we can point to the tutorials folder and incorporate
the markdown files contained in it. As of right now, tutorials cannot
reside in the same directory as code or jsdoc will choke. The readme
file works and makes great sense where it is. So we can additionally
specify that file and incorporate it in.