jsdoc-to-markdown icon indicating copy to clipboard operation
jsdoc-to-markdown copied to clipboard

Respect line endings

Open jaxer opened this issue 8 years ago • 2 comments

Generated doc can end up with mixed encodings on windows. Seems like templates (in jsdoc2md packages) are using LF encoding (as they are installed by npm and not converted by git) and windows sources (by default converted by git) use CRLF.

A bigger problem though is unnecessary diffs generated in cross-platform projects. I.e. if doc generated on Mac and later regenerated on Windows then mixed line endings would result in unnecessary diffs.

jaxer avatar Jan 16 '17 11:01 jaxer

ok.. so what solution would you like to see? Ensure line-endings in generated docs are consistent? If so, should LF or CRLF be the consistent line-ending used? Or some other solution?

75lb avatar Jan 19 '17 09:01 75lb

i think that line-endings should be configurable at best. but at least they should use os.EOL for all output.

yarn had similar problems (https://github.com/yarnpkg/yarn/issues/1061) and they are reusing existing line-endings if destination already exists or using os.EOL otherwise.

jsdoc2md does not have output file defined so i guess making it configurable is a way to go?

jaxer avatar Jan 19 '17 09:01 jaxer