'Geoserver - Legend - Delete group text to keep only that of the element

I would like to delete the group or subgroup text in the caption to keep only that of the element next to the symbol.

How can I do this?

See screenshot.

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source