GetTogetherComm / GetTogether

Event manager for local community events
https://gettogether.community
BSD 2-Clause "Simplified" License
473 stars 87 forks source link

Escape new lines from JSON-ld data #321

Open tcitworld opened 1 year ago

tcitworld commented 1 year ago

The JSON-ld data does not escape newlines, leading to broken data (as JSON does not allow this).

For instance with this event:

<script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "Event",
      "url": "https://gettogether.community/events/34457/freak-stammtisch/",
      "name": "FRe;AK Stammtisch",
      "description": "Einstmals das Treffen der Friendica und Hubzilla Nutzerïnnen aus Berlin und Umgebung. Heute ein munteres Zusammenkommen von Fedizen unabhängig vom der Fediverse Plattform die verwendet wird.

Wir treffen uns in der [c-base](https://c-base.org) - Rungestrasse 20
10179 Berlin.",
      "image": "https://gettogether.community/media/CACHE/images/team_covers/freaks-berlin_fu3bIBO/24d96daa25f309fbc976d6f54e5da3d3.png",
      "organizer": {
          "@type": "Organization",
          "name": "FRe;AK",
          "url": "https://gettogether.community/freaks/"
      },

      "location": {
        "@type": "Place",
        "name": "c-base",
        "address": "Rungestraße 20, 10179 Berlin, Germany"
      },

      "startDate": "2023-07-03T17:00:00+00:00",
      "endDate": "2023-07-03T20:00:00+00:00"
    }
</script>

Some kind of filter here should be enough: https://github.com/GetTogetherComm/GetTogether/blob/6708944bbcecb6d3d1467b096b2d72e991583d51/get_together/templates/get_together/events/show_event.html#L18