HTML lexer/tokenizer #361
BjornRuud
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here is a (high-level) lexer for HTML that I use for parsing strings containing HTML elements for formatting. Feedback is much appreciated.
https://github.com/BjornRuud/HTMLLexer
I initially had a handcrafted parser doing this work and I struggled to get the swift-parsing version to perform at the same speed, but this final version is actually ~3x faster and uses less memory so I'm definitely reaching for swift-parsing for my future parsing needs.
Example: The string
"A <b>bold</b> move"
will outputBeta Was this translation helpful? Give feedback.
All reactions