Open jwoertink opened 4 years ago
Good point. I haven't needed this feature but I imagine someone will. Shouldn't be too hard to add once we get around to it.
Yeah, I have a theme I want to use, but wanted to just get the layout out of the way, and noticed that didn't work 😅
It's because html2lucky does not approve of the theme. Need to find another one 😂
But seriously I also ran into this when doing a page layout with TailwindUI I wanted to convert
Alright, after spending WAY more time than I care to admit on this, it will not be possible to do at this time.
Both of the myhtml and lexbor shards treat the parsing the same as the browser in which it sees HTML snippets as invalid markup so it adds in the missing elements. If we used one of these, the side affect would be that the output would always contain head and body tags no matter what you passed in.
I also took a look at the crystagiri shard which just uses the built-in crystal XML parser. I also tried using the parser natively. The issue with these are that XML parsing doesn't view attributes like @flow-id="thing"
as valid, so it skips those. The other issue is that with XML, it doesn't have an idea of set tags. This means that when it parses something like:
<meta content="">
<meta content="">
what the XML parser sees is <Node name="meta" children=[<Node name="meta">]>
. The second meta becomes a child of the first and then they mess up everything after because there's no </meta>
. You'd have to parse them as self-closing tags for it to work <meta />
.
I have an idea for this, but I'll open up the PR to talk more about it.
HTML to convert
Lucky response