Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags gets confused with text #103

Closed
cohenran opened this issue Dec 19, 2023 · 2 comments
Closed

Tags gets confused with text #103

cohenran opened this issue Dec 19, 2023 · 2 comments

Comments

@cohenran
Copy link

cohenran commented Dec 19, 2023

This code, produces this nice output:
form
  .textarea()
   .addAttr("align", "right")
   .attrRows(50l)
   .attrCols(50l)
   .attrId("id")
   .attrName("name")
   .attrStyle(style)
   .text("text")
  .__();

<textarea align="right" rows="50" cols="50" id="id" name="name" style="width: 89%; height: 77px;">

However, this code, produces a problematic output:
form
 .textarea()
   .addAttr("align", "right")
   .attrRows(50l)
   .text("text")
   .attrCols(50l)
   .attrId("id")
   .attrName("name")
   .attrStyle(style)
  .__();
<textarea align="right" rows="50">text cols="50" id="id" name="name" style="width: 89%; height: 77px;"

All I did was move the .text("text") up, and it made it outside of the textarea tag.
It happened with other properties like attrClass.
If it happens because text returns the parent element, maybe an exception should be thrown if I use attr after.
@fmcarvalho
Copy link
Member

Good catch !!!

And you are right about: maybe an exception should be thrown if I use attr after.

I will fix it according.

Thanks,
Miguel

@fmcarvalho
Copy link
Member

Solved on new release 4.2, following your suggestion of throwing an Exception on that case.

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

No branches or pull requests

2 participants