diff --git a/package.json b/package.json
index 9eab209..7fd5d26 100644
--- a/package.json
+++ b/package.json
@@ -29,6 +29,7 @@
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"fs-extra": "3.0.1",
+ "he": "^1.1.1",
"html-webpack-plugin": "2.29.0",
"jest": "20.0.4",
"ldfetch": "^1.0.6-alpha",
diff --git a/src/components/SidebarBuildingDetail.jsx b/src/components/SidebarBuildingDetail.jsx
index 1275a9f..281c3f9 100644
--- a/src/components/SidebarBuildingDetail.jsx
+++ b/src/components/SidebarBuildingDetail.jsx
@@ -58,22 +58,21 @@ export default class SidebarBuildingDetail extends Component {
}
}
- titleBuild = () => {
- if (this.Building.title.includes("'t")) {
- return "Sporthall";
- } else {
- return this.Building.title;
+ linkOrdescription = () => {
+ if (this.Building.description !== "Geen beschrijving beschikbaar") {
+ return link;
}
+ return
{this.Building.description}
;
}
render() {
return (
- {this.titleBuild()}
+ {this.Building.title.replace(/[&\/\\#,+()$~%.'":;*?<>{}1234567890]/g, '')}
- link to the page
+ {this.linkOrdescription()}
{this.showAccessibilityInformation()}
diff --git a/src/components/SidebarSearchResult.jsx b/src/components/SidebarSearchResult.jsx
index b316285..41d29b0 100644
--- a/src/components/SidebarSearchResult.jsx
+++ b/src/components/SidebarSearchResult.jsx
@@ -42,18 +42,25 @@ export default class SidebarSearchResult extends React.Component {
}
}
+ linkOrdescription = () => {
+ if (this.Building.description !== "Geen beschrijving beschikbaar") {
+ return link;
+ }
+ return {this.Building.description}
;
+ }
+
render() {
return (
- {this.Building.title}
+ {this.Building.title.replace(/[&\/\\#,+()$~%.'":;*?<>{}1234567890]/g, '')}
- link to the page
+ {this.linkOrdescription()}
diff --git a/yarn.lock b/yarn.lock
index dae764c..9127e05 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3354,7 +3354,7 @@ hawk@~3.1.3:
hoek "2.x.x"
sntp "1.x.x"
-he@1.1.x:
+he@1.1.x, he@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"