Fixing digest_custom_html to be treated as HTML (was: Overriding digest.html.erb)

This plugin has been deployed and I’ll probably forget about this very soon, so if anyone wants to use these digest_custom_html fields as intended, you can add code like this to your app.yml to patch the source. I was too lazy to make a regex that replaces them all, and instead just did the one that I was using. Modify as appropriate for your use case.

I created a template in the plugin that can then be included in the app.yml. That makes it a tiny bit easier than fussing with a whole block of yaml.

hooks:
  after_code:
    - replace:
        filename: "/var/www/discourse/app/views/user_notifications/digest.html.erb"
        from: 'digest_custom_html("above_footer") '
        to: 'digest_custom_html("above_footer").html_safe '
1 Like