Skip to content

Commit

Permalink
Fixed a scenario where --EOL failed to correctly replace naked CR cha…
Browse files Browse the repository at this point in the history
…racters created by jsdoc. Fixes #102.
  • Loading branch information
75lb committed Sep 25, 2024
1 parent 47cee80 commit 0ad5e27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ async function generate (templateData, options) {

if (options.EOL) {
output = output.replace(/\r?\n/gm, options.EOL === 'posix' ? '\n' : '\r\n')
/* Additional check for naked \r characters created by jsdoc */
/* See: https://github.com/jsdoc2md/dmd/issues/102 */
output = output.replace(/\r(?!\n)/g, options.EOL === 'posix' ? '\n' : '\r\n')
}

dmd.cache.writeSync([inputData, inputOptions, dmdVersion], output)
Expand Down

0 comments on commit 0ad5e27

Please sign in to comment.