Skip to content

Conversation

@Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Oct 28, 2025

Jira URL

https://jira.xwiki.org/browse/XWIKI-22999

Changes

Description

  • Fixed a missing style (forgot it when moving things back from my test instance?)
  • Fixed the HTML5 validity test by wrapping the placeholder in a li

Clarifications

  • On a XWiki instance that's working as expected, actual users will probably never see this placeholder. This bug has little to no impact on the user experience.

Screenshots & Video

Before this PR:
Screenshot from 2025-10-27 10-44-22
After this PR:
image

Executed Tests

Built the changes with mvn clean install -f xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-api.

Tested mvn clean install -f xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/xwiki-platform-distribution-flavor-test-webstandards with the HTML5 validator only. Somehow the tests failed on another page, for what seems like unrelated reasons. I could reproduce the errors before the changes and not anymore after the changes so it seems like it's an improvement. Note that I could not get -Dpattern to work on the build, and despite removing the other validators from my tests, it still took 35mins to run once...

Expected merging strategy

* Fixed a missing style (forgot it when moving things back from my test instance?)
* Fixed the HTML5 validity test by wrapping the placeholder in a li
@Sereza7 Sereza7 requested a review from surli October 28, 2025 13:43
return computeAsyncPlaceholder(response, configuration.isCount());
// We wrap the async placeholder in a listitem which makes it more consistent with the
// result of the macro.
return String.format("<li>%s</li>", computeAsyncPlaceholder(response, configuration.isCount()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this won't lead to nested <li> elements once the placeholder has been resolved?

Copy link
Contributor Author

@Sereza7 Sereza7 Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the help! You're right, I updated the PR to avoid this issue in 032ae95 👍

Here is what the DOM looked like
image

And what it looks like now:
image

The async script uses the data contained on the placeholder to replace it:

I misread the method signature of computeAsyncPlaceholder and thought it was an API. But in fact it's just a private method and we should be free to update it and its result.


I tested this change manually on my local instance (see screenshot above).

* Changed the solution to avoid the placeholder replacement resulting in leftover DOM.
@surli surli merged commit 24a541f into xwiki:master Oct 31, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants