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

HTML Output for "attrs()" in combination with ".withClass()" does not work #224

Open
rrarrarra opened this issue Nov 6, 2023 · 0 comments

Comments

@rrarrarra
Copy link

Actual behavior (the bug)

<div class="def"></div>

Expected behavior

<div class="abc def"></div>

To Reproduce

import static j2html.TagCreator.*;

import org.junit.Assert;

public class Bug {
	
	public static final void bug() {
		
		final String html = div(attrs(".abc"))
			.withClass("def") //or:  .withClasses("def")
			.withText("")
			.render();
		
		System.out.println(html); // prints:  <div class="def"></div>
		
		Assert.assertEquals("<div class=\"abc def\"></div>", html); // Expected is:  <div class="abc def"></div>
	}
	
}
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

1 participant