 		}
 
 		var openTag = ""
-		if !styles.isEmpty {
-			let styleAttributes = "style='\(styles)'"
+		if styles.isEmpty == false {
+            let separator = "; "
+            let styleString = styles.joined(separator: separator) + separator
+			let styleAttributes = "style='\(styleString)'"
 			openTag += self.defaultName.openTag(with: styleAttributes)
 		} else if links.isEmpty {
 			openTag += self.defaultName.openTag()

				guard self.ignoreParagraphStyles == false else { return }
				guard let paragraphStyle = value as? NSParagraphStyle else { return }

				styles += "text-align: \(paragraphStyle.alignment.htmlAttributeValue); "
			case .baselineOffset:
				guard let offset = value as? Float else { return }

				styles += "-cocoa-baseline-offset: \(offset); "
			case NSAttributedStringKey(rawValue: "NSSuperScript"):
                guard let offset = value as? Int, offset != 0 else { return }

                let verticalAlignment = offset > 0 ? "super" : "sub"
                styles += "vertical-align: \(verticalAlignment); "
                styles += "-cocoa-vertical-align: \(offset); "
			default:
				assertionFailure("did not handle \(key)")
			}

		}
	}
}

// MARK: - Array

private extension Array where Element: Hashable {

    mutating func insertFront(_ element: Element) {
        self.insert(element, at: 0)
    }

    mutating func insertBack(_ element: Element) {
        self.append(element)
    }
}
