Closed jamierocks closed 5 years ago
Would you like to submit a PR? :)
:+1: See GH-139 :)
@tipsy Hi, since I stumbled over the same issue, would you consider to create a new release?
(and it would be great to also have a public method renderFormatted(Appendable)
😉 )
Thanks a lot!
Hey! I have to admit I've lost track of the current master branch, I'm not sure if there are breaking changes. You were quite active last year @pointbazaar, do you know?
Yes, there are. I've cloned and installed the library locally and got compile errors with
html().withLang('en').with(
head(...),
body(...)
)
The with(...)
method is missing.
Actually, I like declaring the attributes before the content (just as in the HTML markup), so please bring it back. 🙂
Moreover, when changing this to
html(
head(...),
body(...)
).withLang('en')
then the lang
attribute isn't rendered.
Are you a heavy user of the project @obecker? I need someone to be in charge of what goes into the next release.
Hi @tipsy, I started using j2html one week ago for a project of mine, and I'm still exploring all of its features. So. I'm not the one to decide when the next release is ready. However, I can assist in testing and may also look into the code. Cheers, Oliver
Not an ideal fit, no... 😅 I'll try to find someone for that job soon :)
@tipsy sorry for responding so late. changes to the API were absolutely intended by me, as part of making the API more typesafe. The changes would break some small amount of code, but only invalid html , and it would be very easy for users of the library to adjust their code.
@obecker that the .withLang('en')
does not work is absolutely unintended. (at least by my changes)
https://www.w3schools.com/tags/att_global_lang.asp
specifies a global 'lang' attribute, so it should be present on all tags.
the implementation https://github.com/tipsy/j2html/blob/be626b6b9659458248738ec5f6f57fd672233eff/library/src/main/java/j2html/tags/Tag.java#L198
is written in the Tag
class and if it does not work there is a chance of
all those similar methods around it also being affected.
but basic Tag features like this should have tests if i remember correctly...
As for the next release, it would be great if my changes could make it in there :) I hope there are no problems with them.
Maybe open source projects depending on j2html could be found, then tried with the new version before making a release. You see, i have no idea about releases :)
I wish i had more time :(
Maybe this closed issue is not the best place for discussing these other issues. Nevertheless..
The HtmlTag
problem stems from the fact that this is apparently a custom implementation that is not complete (most of the tag classes are in j2html.tags.specialized.generated
, HtmlTag
is the only class with some extra logic in j2html.tags.specialized.manual
). It tries to enforce allowing only head
and body
as children, but in my eyes it is not worth this effort. To keep things simple I would remove this logic (since there is also no similar logic for table
, tr
or other tags).
Just my 2 cents ...
No worries @pointbazaar, sorry for forgetting about your changes too :)
@obecker @pointbazaar I've made an issue here https://github.com/tipsy/j2html/issues/172 to discuss the future of the project, you can move the discussion there. I've found a new maintainer (and another person willing to step up). It would be good if we could all get aligned.
The
pre
tag is correctly not formatted, though it's children shouldn't be either, as they will affect the look of the page.This can be seen by: