Deal with replacements a little more gracefully
linebreaksbr breaks diffs, so we implement this hack for now
Minor changes