When using a "Leaflet Map" view, the settings (style options) has an option "Title Field" which has a description "Choose the field which will appear as a title on tooltips. " If we set this value to "Content: Title", then the node titles correctly appear as a popup when hovering over a marker.
However if the node title includes a special character, this gets double html encoded - for example "A & B" comes out as "A & B".
The cause is that LeafletMap::render fetches the rendered field which is already HTML encoded
$point['label'] = $this->rendered_fields[$id][$this->options['name_field']];
And when the js code eventually sets the title attribute on the image, it naturally/securely HTML encodes the passed string.
So a possible fix is to HTML decode the rendered field. I'm not sure if that's the best fix - maybe someone has a better idea. As far as I can see this is safe because javascript provides the security by HTML encoding again.
Patch coming up.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | leaflet.html-entity-encode-2978612-2.patch | 906 bytes | adamps |
Comments
Comment #2
adamps commentedComment #4
itamair commentedNice catch @AdamPS, committed to last dev ...
Comment #5
adamps commentedThanks @itamair