Started a new PR to fix the lack of escaping mentionned previously: https://github.com/xwiki/xwiki-platform/pull/2582