             if components.count == 1 {
                 replaceCharacters(inRange: range, withSanitizedString: string)
             } else {
-                replaceCharacters(inRange: range, withComponents: components)
+                replaceCharacters(inRange: range, withComponents: components, separatedBy: ElementNodeDescriptor(elementType: .br))
             }
         }
 

            if components.count == 1 {
                append(sanitizedString: string)
            } else {
                append(componentsSeparatedByBreaks: components)
            }
        }


            contents.replaceSubrange(range, with: string)
        }
        
        /// Replaces the specified range with an array of string components separated by nodes
        /// specified using a node descriptor.
        ///
        /// This could be use, for example, to separate components with line breaks.
        ///
        /// - Parameters:
        ///     - range: the range to replace.
        ///     - components: an array of strings that will be inserted replacing the specified
        ///         range.  These will be separated by the specified separator.
        ///     - separatorDescriptor: the node to use to separate the specified components.
        ///
        private func replaceCharacters(inRange range: NSRange,
                                       withComponents components: [String],
                                       separatedBy separatorDescriptor: ElementNodeDescriptor) {
            guard let firstComponent = components.first,
                let lastComponent = components.last else {
                    assertionFailure("This should not be possible, review your logic.")
