[#30777] Removes html elements used in the wrong context (Fix #1079)