You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0b4b423
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: API.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,7 +214,7 @@ Set the render function used in the results dropdown
214
214
215
215
#### Parameters
216
216
217
-
*`fn`**[Function][85]** The function to use as a render function. This function accepts a single [extended GeoJSON][86] object as input and returns a string.
217
+
*`fn`**[Function][85]** The function to use as a render function. This function accepts a single [extended GeoJSON][86] object as input and returns a string. If `fn` is not a function, the default render function is used.
* Set the render function used in the results dropdown
1124
-
* @param {Function} fn The function to use as a render function. This function accepts a single [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) object as input and returns a string.
1124
+
* @param {Function} fn The function to use as a render function. This function accepts a single [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) object as input and returns a string. If `fn` is not a function, the default render function is used.
1125
1125
* @returns {MapboxGeocoder} this
1126
1126
*/
1127
1127
setRenderFunction: function(fn){
1128
-
if(fn&&typeof(fn)=="function"){
1129
-
this._typeahead.render=fn;
1130
-
}
1128
+
// Fall back to the escaping default: keeping the suggestions library's own renderer would inject place_name unescaped
0 commit comments