(First post, so bear with me…)
I recently set up my own Discourse forum: https://crucible.hubbe.net/ for the most part I’ve been very happy with it. The community is for an arduino-type board used mostly for prop makers. As such, we end up using a lot of templated C++ code. In particular, we use this thing called a “style” which configures how lights show up. Styles can be complicated, so I wrote an online previewer/editor, then I used the discourse-linkify theme component to make it so that styles are automatically linked to the editor. I had to make some minor changes to the discorse-linkify theme component to make it quote URL characters and stuff, which was easy enough, and I can create a PR for those changes if there is interest.
The result can be seen here: StylePtr links - The Crucible - The Crucible
However, there is a problem…
Some of the templated code ends up looking a bit like HTML because of all the < and > characters, and at some point Discourse removes some of those “tags”. Basically, it seems like any unknown word encased in < > gets removed. The next line in this post will be < foo > but without the spaces:
< - the foo is here
At first I thought it was the linkfy component that was doing something wrong, but after some digging, it seems that the missing stuff is already gone by the time linkify runs. So I guess the extra tags evaporated somewhere in the cooking process?
I noticed that in code blocks (triple-backtick and similar) the tags do survive, but for my purposes it would be better if they always survived.
For a while I thought that it would be sufficient to modify discourse/lib/utilities.cs:CODE_BLOCKS_REGEXP to make this work, but inCodeBlock isn’t used from a lot of places, so maybe that’s wrong? Also, I have not figured out how to actually modify CODE_BLOCKS_REGEXP from a plugin or theme component yet.
What code is actually responsible for removing these tags?
What is the best (most supported) way to disable it?