feat: truncate description

This commit is contained in:
2025-06-15 17:42:02 +02:00
parent 623ca8bc0a
commit 89e001bd17
2 changed files with 4 additions and 1 deletions

View File

@@ -19,3 +19,6 @@ function geojson_to_searchable_string(location) {
return ifdef(location.properties.name, "", ", ") + ifdef(location.properties.street, "", ifdef(location.properties.housenumber, " ",", ")) + ifdef(location.properties.city, "", ", ") + ifdef(location.properties.country, "", "")
}
function truncate(str, n, url){
return (str.length > n) ? str.slice(0, n-1) + '<a href="' + url + '">&hellip;</a>' : str;
};