Fix EZP-21986: Removing an underline removes the surrounding custom tag
Added unit tests for EZP-21986