From 14ca4d330977f8b79e40ae818001e5a494af3c5e Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Mon, 19 Jun 2017 12:36:03 -0300 Subject: [PATCH] Fixes a bug. --- .../HTMLNodeToNSAttributedString.swift | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift b/Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift index fbb96217a..8a27bd514 100644 --- a/Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift +++ b/Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift @@ -152,18 +152,17 @@ class HTMLNodeToNSAttributedString: SafeConverter { fileprivate func string(for element: ElementNode, inheriting attributes: [String:Any]) -> NSAttributedString { let childAttributes = self.attributes(for: element, inheriting: attributes) - + let content = NSMutableAttributedString() + if let nodeType = element.standardName, let implicitRepresentation = nodeType.implicitRepresentation(withAttributes: childAttributes) { - - return implicitRepresentation - } - let content = NSMutableAttributedString() - - for child in element.children { - let childContent = convert(child, inheriting: childAttributes) - content.append(childContent) + content.append(implicitRepresentation) + } else { + for child in element.children { + let childContent = convert(child, inheriting: childAttributes) + content.append(childContent) + } } guard !element.needsClosingParagraphSeparator() else {