Skip to content


Need to consider cross-platform linebreak handling #2

jonm opened this Issue · 0 comments

1 participant


RFC 2046 requires that text/* types use CRLF as linebreaks, which is how the grammar is currently written. However, I suspect that many actual diff outputs would not actually adhere to this on a byte-for-byte basis. In particular, I suspect that most Unix diffs will just use newlines. There are a few possibilities for addressing this:

  • Just allow multiple linebreak types, so long as they are consistent through the file (this is the RFC 2616 approach for HTTP)
  • Register it as application/diff instead of text/diff.
  • Augment the grammar to allow for multiple (but consistent) linebreak styles. This might mean that a newline-terminated patch file might "look" to a generic text/plain processor as a single long line, but maybe that's ok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.