I'm not sure what you mean by "deal with line endings", but sed can operate across multiple lines.
https://www.gnu.org/software/sed/manual/html_node/Text-searc...
% echo 'one\ntwo\nthree' | sed -e 's,$, four,' one four two four three four
> echo ‘one\ntwo\nthree’ | tr \n \| one|two|three