Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Some HTML Tag will outputs as wrong lowercase #1

Open
ipfans opened this issue Oct 22, 2021 · 3 comments
Open

Some HTML Tag will outputs as wrong lowercase #1

ipfans opened this issue Oct 22, 2021 · 3 comments

Comments

@ipfans
Copy link

ipfans commented Oct 22, 2021

This is a very useful tool, great works! However, I found that some of the tags are marked as lowercase in the transcription process. For example, TBody -> Tbody and FieldSet -> Fieldset.

Some tags like SVG, will be ignored, but I guess this is caused by the problem that go-app itself doesn't support. Maybe it can translate to RAW or something else.

@pojntfx
Copy link
Owner

pojntfx commented Oct 22, 2021

Thanks! Yeah, the SVG situation is a bit of a bummer - I haven't found a way to use app.Raw with it properly yet so I just skip it for now. In the future, maybe I could pass a flag to the traversal function or something. go-app doesn't support the path elements and so on yet.

I'll take a look at fixing the tag names right away. Did you notice any others which where wrong? The logic is in https://github.com/pojntfx/html2goapp/blob/main/pkg/converter/goapp.go#L181-L215 so fixing them is trivial :)

@ipfans
Copy link
Author

ipfans commented Oct 24, 2021

@pojntfx Not yet, I just run a demo transcrption. I think it can be a demo html with all tags go-app supported. I will try this later.

@pojntfx
Copy link
Owner

pojntfx commented Oct 24, 2021

@ipfans I've just released https://github.com/pojntfx/html2goapp/tree/v1.2.1 which should fix the two tags. While searching for a less manual solution I found https://github.com/maxence-charriere/go-app/blob/master/pkg/app/gen/html.go - maybe one could base the conversion on the generated code using reflection?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants