 
         switch self[next] {
         case " ":
-            return parseTagStart(after: next)
+            return parseTag(after: next)
         case "/":
             let closeTag = index(after: next)
             guard closeTag < endIndex else {
                 return .none
             }
-            if let (option, end) = parseInnerTag(from: closeTag) {
-                return (.close(option), tagStart..<end)
-            } else {
-                return .none
-            }
+            return parseInnerTag(from: closeTag).map { tag, end in (.close(tag), tagStart..<end) }
         default:
-            if let (option, end) = parseInnerTag(from: next) {
-                return (.open(option), tagStart..<end)
-            } else {
-                return .none
-            }
+            return parseInnerTag(from: next).map { tag, end in (.open(tag), tagStart..<end) }
         }
     }
 
     private func parseInnerTag(from start: Index) -> (Formatting?, Index)? {
-        let next = index(after: start)
-        guard let close = range(of: ">", range: next..<endIndex)?.lowerBound else {
+        guard let close = range(of: ">", range: start..<endIndex)?.lowerBound else {
             return .none
         }
 
-        let end = range(of: " ", range: next..<close)?.lowerBound ?? close
+        let end = range(of: " ", range: start..<close)?.lowerBound ?? close
         let tag = self[start..<end]
         return (htmlTags[tag], close)
     }

            let character = self[position]
            switch character {
            case "<":
                guard let (tag, range) = parseTagStart(after: position) else {
                    break parser
                }

                switch tag {
                case let .open(.some(innerTag)):
                    if innerTag == .paragraph {
                        if range.lowerBound == startIndex {
                            balancedStartParagraphTag = true

    }

    private func decode(base: Int) -> Character? {
        return UInt32(self, radix: base)
            .flatMap(UnicodeScalar.init)
            .flatMap(Character.init)
    }
}
