         font = defaultFont
         
         storage.setHTML(html, defaultAttributes: defaultAttributes)
-
-        if storage.length > 0 && selectedRange.location < storage.length {
-            typingAttributesSwifted = storage.attributes(at: selectedRange.location, effectiveRange: nil)
-        }
+        recalculateTypingAttributes()
 
         notifyTextViewDidChange()
         formattingDelegate?.textViewCommandToggledAStyle()

    ///
    public func setHTMLUndoable(_ html: String) {
        replace(storage.rangeOfEntireString, withHTML: html)
    }

    /// Loads the specified HTML into the editor.

        restoreDefaultFontIfNeeded()

        ensureRemovalOfLinkTypingAttribute(at: selectedRange)

        // WORKAROUND: iOS 11 introduced an issue that's causing UITextView to lose it's typing
        // attributes under certain circumstances.  The attributes are lost exactly after the call
