fixes a bug that prevented showing a legend with custom HTML
Fixes bug that prevented showing the custom HTML legend in the share window