jsdoc3/jsdoc — pull request #225 by matthewkastor (2012-10-15 21:59:35+00:00)
Title: Markdown - Filters input EOL 2

Is this working out for you hegemonic?

I changed a setting in git to try and stop it from converting line
endings when I get files or send them. By default it converts things and
the documentation on turning it off is sketchy at best. I found a lot of
people saying that turning it off can cause all sorts of unspecified
doom... anyway. . .

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. 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:

/**
* 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.