     ///
     func enumerateParagraphNodes(in style: ParagraphStyle, block: ((ElementNode) -> Void)) {
         if style.blockquote != nil {
-            block( ElementNode(type: .blockquote) )
+            let node = ElementNode(type: .blockquote)
+            block(node)
         }
 
         if style.htmlParagraph != nil {
-            block( ElementNode(type: .p) )
+            let node = ElementNode(type: .p)
+            block(node)
         }
 
         if style.headerLevel > 0 {
-            let header = DOMString.elementTypeForHeaderLevel(style.headerLevel) ?? .h1
-            block( ElementNode(type: header) )
+            let type = DOMString.elementTypeForHeaderLevel(style.headerLevel) ?? .h1
+            let node = ElementNode(type: type)
+            block(node)
         }
 
         if !style.textLists.isEmpty {
-            block( ElementNode(type: .li) )
+            let node = ElementNode(type: .li)
+            block(node)
         }
 
         for list in style.textLists {
-            if list.style == .ordered {
-                block( ElementNode(type: .ol) )
-            } else {
-                block( ElementNode(type: .ul) )
-            }
+            let node = list.style == .ordered ? ElementNode(type: .ol) : ElementNode(type: .ul)
+            block(node)
         }
     }
 

    ///
    func createLeafNodes(from attrString: NSAttributedString) -> [Node] {
        let attachment = attrString.attribute(NSAttachmentAttributeName, at: 0, effectiveRange: nil) as? NSTextAttachment
        var leafs = [Node]()

        switch attachment {
        case let lineAttachment as LineAttachment:
            let node = lineAttachmentToNode(lineAttachment)
            leafs.append(node)
        case let commentAttachment as CommentAttachment:
            let node = commentAttachmentToNode(commentAttachment)
            leafs.append(node)
        case let htmlAttachment as HTMLAttachment:
            let nodes = htmlAttachmentToNode(htmlAttachment)
            leafs.append(contentsOf: nodes)
        case let imageAttachment as ImageAttachment:
            let node = imageAttachmentToNode(imageAttachment)
            leafs.append(node)
        default:
            let nodes = textToNode(attrString.string)
            leafs.append(contentsOf: nodes)
        }

        return leafs
    }
}


                output.append(newline)
            }

            let node = TextNode(text: substring)
            output.append(node)
        }
        
        return output
