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

Comments break JTE #359

Closed
tschuehly opened this issue May 16, 2024 · 5 comments
Closed

Comments break JTE #359

tschuehly opened this issue May 16, 2024 · 5 comments
Assignees

Comments

@tschuehly
Copy link
Contributor

Hello @casid ,
I'm using JTE in my server-side rendering with Spring workshop: https://tschuehly.gitbook.io/server-side-spring-htmx-workshop/lab-3-inline-editing

To explain the code snippets I added JTE comments with <%-- (1) --%> to the code.

@import static de.tschuehly.easy.spring.auth.group.GroupController.*
@param de.tschuehly.easy.spring.auth.group.management.table.user.AddUserComponent.AddUserContext addUserContext
<form hx-post="${HtmxUtil.URI(POST_ADD_USER,addUserContext.groupName())}" <%-- (1) --%>
      hx-target="${HtmxUtil.target(GroupTableComponent.GROUP_TABLE_ID)}" <%-- (2) --%>
      hx-swap="outerHTML"> <%-- (2) --%>
    <select>
        @for(var easyUser: addUserContext.easyUserList()) <%-- (3) --%>
            <option value="${easyUser.uuid.toString()}">
                ${easyUser.username}
            </option>
        @endfor
    </select>
    <button type="submit">Add User to group</button>
</form>

This breaks JTE rendering, it will still render but the attributes after the first comment are not part of the tag anymore.

If I instead use normal HTML comments <-- --> in the same place, JTE will render it correctly but the syntax highlighting of the JTE plugin will break.

I would expect that the JTE comments are completely ignored from rendering.

It would be lovely if you could provide a hotfix as I'm repeating the workshop two times in the next two weeks.

Thank you!

@casid casid self-assigned this May 16, 2024
@casid
Copy link
Owner

casid commented May 16, 2024

Thank you for reporting @tschuehly and thanks for sharing your workshop. That is pretty cool!

I think this issue should be fixed now. Would you be able to try if it works with all your workshop examples as well? You should be able to test with the latest snapshot release:

https://jitpack.io/#casid/jte/-SNAPSHOT

Once you confirm the fix, I will create a new bugfix release.

@tschuehly
Copy link
Contributor Author

Thank you for the quick fix! I can try it out next week.

@tschuehly
Copy link
Contributor Author

Hey @casid
I finally had time to test it. The fix works!
Would be awesome if you could create a bugfix release.

Jitpack seems to have a problem building the runtime: https://jitpack.io/com/github/casid/jte/3ad76aa95f/build.log
But I've built locally

@casid
Copy link
Owner

casid commented May 24, 2024

Hi @tschuehly,

thank you for testing and confirming the fix!

I will release a new version today.

Jitpack seems to have a problem building the runtime

It looks like Jitpack still uses Java 8 for building and the --release option is not available there yet.

Cheers!

@casid
Copy link
Owner

casid commented May 24, 2024

jte 3.1.12 is now published, containing this fix.

@casid casid closed this as completed May 24, 2024
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