Skip to content

Commit

Permalink
Fixes a bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreymendez committed Jun 19, 2017
1 parent e054e88 commit 14ca4d3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Aztec/Classes/Converters/HTMLNodeToNSAttributedString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 14ca4d3

Please sign in to comment.