getfider / fider

Open platform to collect and prioritize feedback
https://fider.io
GNU Affero General Public License v3.0
2.87k stars 627 forks source link

Markdown: Allow configuring which links are safe to keep in the user content #1089

Open onionltd opened 2 years ago

onionltd commented 2 years ago

gomarkdown allows adding items to the list of URLs which are safe to convert to HTML links. By default gomarkdown supports http(s)://, ftp://, and mailto:. I'm wondering what would be the best way to implement adding more from within the configuration file.

onionltd commented 2 years ago

I patched fider's markdown package so it consumes ENV variables, and then patched the configuration structs so it accepts a list of values - URIs. However, I later found that markdown rendering is handled by the frontend application and not the backend, except for the parts which deal with notifications and emails content.

I don't much understand the decision to have a markdown renderer on the frontend instead of just accepting already rendered content in form of HTML, but it is what it is. I wonder what's the best way to move forward.