     ]
 
     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()
-        }
+        return self.usedTagName.closeTag()
     }
 
     // MARK: - Private

                                                    } else {
                                                        guard let range = Range(nsrange, in: attributedString.string) else { return }

                                                        let tag = HTMLTag(defaultName: .span, attributes: attributes, ignoreParagraphStyles: true)
                                                        paragraphContent += tag.makeOpenTag()
                                                        paragraphContent += String(attributedString.string[range]).htmlEscaped
                                                        paragraphContent += tag.makeCloseTag()
                                                    }
            })

            html += paragraphTag.makeOpenTag() + paragraphContent + paragraphTag.makeCloseTag()
        }

        return html

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

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