We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I'm trying to write following template:
<div th:replace="~{:: my-fragment(icon=~{:: /span})}"> <span class="icon">X</span> </div> <th:block th:remove="all"> <div th:fragment="my-fragment(icon)"> my-fragment <span th:replace="${icon}"></span> </div> </th:block>
According to markup selector syntax (if I read it correctly) ~{:: /span} should select span inside current node.
~{:: /span}
span
But it seems that ~{:: /span} on line 1 is unable to select <span>Hello</span> and pass it to my-fragment.
<span>Hello</span>
my-fragment
The text was updated successfully, but these errors were encountered:
I have run into this myself as well.
The documentation states
The basic syntax includes: /x means direct children of the current node with name x.
/x
However /sth seems to select all <sth> that are a direct descendant of the document root instead of the direct descendants of the current node.
/sth
<sth>
In your case
<div th:ref="example" th:replace="~{:: my-fragment(icon=~{:: example/span})}"> <span class="icon">X</span> </div> <th:block th:remove="all"> <div th:fragment="my-fragment(icon)"> my-fragment <span th:replace="${icon}"></span> </div> </th:block>
should work
Sorry, something went wrong.
No branches or pull requests
Hello,
I'm trying to write following template:
According to markup selector syntax (if I read it correctly)
~{:: /span}
should selectspan
inside current node.But it seems that
~{:: /span}
on line 1 is unable to select<span>Hello</span>
and pass it tomy-fragment
.The text was updated successfully, but these errors were encountered: