                                                     } else {
                                                         guard let range = Range(nsrange, in: attributedString.string) else { return }
 
-                                                        let tag = HTMLTag(defaultName: .span, attributes: attributes, ignoreParagraphStyles: true)
-                                                        paragraphContent += tag.makeOpenTag()
+                                                        var tag = HTMLTag(defaultName: .span, attributes: attributes, ignoreParagraphStyles: true)
+                                                        paragraphContent += tag.parseOpenTag()
                                                         paragraphContent += String(attributedString.string[range]).htmlEscaped
                                                         paragraphContent += tag.makeCloseTag()
                                                     }
             })
 
-            html += paragraphTag.makeOpenTag() + paragraphContent + paragraphTag.makeCloseTag()
+            html += paragraphTag.parseOpenTag() + paragraphContent + paragraphTag.makeCloseTag()
         }
 
         return html

    ]

    func makeCloseTag() -> String {
        let containsStyle = self.attributes.contains(where: { HTMLTag.styleAttributes.contains($0.key) })
        let containsLinks = self.attributes.contains(where: { $0.key == .link })

        if containsLinks {
            var closeTag = ""
            closeTag += Name.a.closeTag()
            if containsStyle {
                closeTag += self.defaultName.closeTag()
            }
            return closeTag
        } else {
            return self.defaultName.closeTag()
        }
    }

    // MARK: - Private

                guard let url = value as? URL else { return }

                links = "href='\(url.absoluteString)'"
                self.hasParsedLinks = true
            default:
                assertionFailure("did not handle \(key)")
            }
