         undoManager?.registerUndo(withTarget: self, handler: { [weak self] target in
             self?.undoTextReplacement(of: originalText, finalRange: finalRange)
         })
+
         let attachmentString = NSAttributedString(attachment: attachment, attributes: typingAttributesSwifted)
         storage.replaceCharacters(in: range, with: attachmentString)
         selectedRange = NSMakeRange(range.location + NSAttributedString.lengthOfTextAttachment, 0)


        aztecLayoutManager.extraLineFragmentTypingAttributes = { [weak self] in
            return self?.extraLineFragmentTypingAttributes ?? [:]
            }
    }

    // MARK: - Intercept copy paste operations

        })

        let formatter = LinkFormatter()
        formatter.attributeValue = url

        let attributes = formatter.apply(to: typingAttributesSwifted)
        storage.replaceCharacters(in: range, with: NSAttributedString(string: title, attributes: attributes))

        selectedRange = NSRange(location: finalRange.location + finalRange.length, length: 0)
