BB 2&3: lexemes and name parser
Lexeme: basically, the smallest block that I actually
care about.
lexeme :: forall p. Parser p -> Parser p
lexeme p = p <* skipSpace
I.e. for a given parser, I want to use it to parse my
target and then snip off all of the trailing “spaces”
Name: tag and attribute names can have just about
any character in my lenient HTML, except for
particles.
validNameString :: Parser String
validNameString =
flattenChars <$> many1
(noneOf ['=', ' ', '<', '>', '/', '"'])
flattenChars :: List Char -> String
flattenChars =
trim <<< fromCharArray <<< fromFoldable