AddEvent code not working in Discourse

The cause here is that Discourse filters user input in posts as a security measure. You wouldn’t want random users to run scripts on your site, so we filter them out.

You can use a theme component to make this work. If you add something like this in a new theme component - under the header tab - and then add it to your active theme, you’ll be able to use that embed.

<script type="text/discourse-plugin" version="0.8">
  const  loadScript  = require("discourse/lib/load-script").default;
  const { next } = require("@ember/runloop");

  api.decorateCookedElement(
    post => {
      const calendars = post.querySelectorAll(`[data-wrap="addEvent"]`);
      if (!calendars.length) return;

      calendars.forEach(calendar => {
        const wrapper = document.createElement("div");
        wrapper.dataset.calendar = calendar.dataset.calendar;
        wrapper.dataset.configure = false;
        wrapper.classList.add("ae-emd-cal");
        calendar.append(wrapper);
      });

      next(() =>
        loadScript("https://addevent.com/js/cal.embed.t1.init.js")
      );
    },
    { id: "AddEvent decorator", onlyStream: true }
  );
</script>

Once you do that, you can add the addEvent calendar to a post by adding something like this in your post.

[wrap=addEvent calendar=bJ306355][/wrap]

You can change the calendar=bJ306355 attribute to add the specific identifier for the calendar you want to embed.

The last thing you need to do is whitelist the AddEvent script in your site setting (this is another security layer).

Search for the content_security_policy_script_src in the admin and add this link there

https://addevent.com

Let me know if this works for you, and I can package it as a theme component.