misc: do not escape twice map attribution (#89602)
gitea/wcs/pipeline/head This commit looks good
Details
gitea/wcs/pipeline/head This commit looks good
Details
This commit is contained in:
parent
a16990b96a
commit
f3b97917a9
|
@ -53,10 +53,19 @@ def test_form_map_field_back_and_submit(pub):
|
|||
),
|
||||
]
|
||||
formdef.store()
|
||||
resp = get_app(pub).get('/test/')
|
||||
formdef.data_class().wipe()
|
||||
resp = get_app(pub).get('/test/')
|
||||
assert 'qommon.map.js' in resp.text
|
||||
assert 'qommon.geolocation.js' in resp.text
|
||||
assert (
|
||||
resp.pyquery('.qommon-map')[0].attrib['data-tile-urltemplate']
|
||||
== 'https://tiles.entrouvert.org/hdm/{z}/{x}/{y}.png'
|
||||
)
|
||||
assert (
|
||||
resp.pyquery('.qommon-map')[0].attrib['data-map-attribution']
|
||||
== 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
)
|
||||
|
||||
# with a real user interaction this would get set by javascript
|
||||
resp.forms[0]['f0$latlng'].value = '1.234;-1.234'
|
||||
assert 'data-geolocation="road"' in resp.text
|
||||
|
|
|
@ -3659,6 +3659,7 @@ class MapWidget(CompositeWidget):
|
|||
def init_map_attributes(self, value, **kwargs):
|
||||
self.map_attributes = {}
|
||||
self.map_attributes.update(get_publisher().get_map_attributes())
|
||||
self.map_attributes['data-map-attribution'] = mark_safe(self.map_attributes['data-map-attribution'])
|
||||
self.sync_map_and_address_fields = get_publisher().has_site_option('sync-map-and-address-fields')
|
||||
if kwargs.get('initial_zoom') is None:
|
||||
kwargs['initial_zoom'] = get_publisher().get_default_zoom_level()
|
||||
|
|
Loading…
Reference in New Issue