How can I parse an html string for example <p>Test</p>
and have this be converted to value that would be similar to p_ "Test"
?
So the function type would be String -> Html ()
.
I've found the following project https://github.com/dbaynard/lucid-from-html but this generates actual Haskell source code as a String
.
I'm aware that there are HTML parsing libraries, but I'm just wondering if there already exists a library that has implemented this?
Test
`, so its actually already rendered HTML rather than any sort of DOM. As such, you don't really gain anything by parsing the HTML and then re-rendering it to `Html ()` -- it'll be a sort of expensive identity function. If you need to validate or normalize some HTML before rendering, you'd *still* be better off using a completely separate library (maybe HXT?) to parse and re-render it, and then use Lucid's `toHtmlRaw` on your re-rendered HTML. – K. A. Buhr Apr 07 '19 at 19:16