Changed replaceAll() to replace(). Added support for Windows line break replacement in edit_contentlet_relationships.jsp This resolves an issue with Windows line breaks breaking the JavaScript in the JSP, which prevented related content from being displayed.
Added support for replacement of standalone instances of \r based on jkshapiro's recommendation. I've never encountered an issue with this, but it might be wise to account for it.