Changes in swift syntax with respect to enums:

new:

if let type = HTMLNodeType.fromRaw(tagName) {

old:

if let type = HTMLNodeType(rawValue: tagName) {