Something of note as I am leaning about Discourse that might be of help, a curse, etc.
The text for a post is stored in a PostgreSQL database in a table named posts. There are however two fields that hold the text for a post, raw and cooked. raw appears to hold the text as entered and cooked also appears to hold all of the text with changes. Please don’t ask me why, when they are used, how they are created, what is the difference at this point.
That is not handled now (you get the first answer). It is needed for only a couple of cases, but should probably be added at some point. This was a quick hack in between that should be enough to play with the idea.
Okay! That was a little annoying, but I’ve made a little component theme that’s active now that should automatically format valid links; e.g. member/2, memberchk/2, integer//1, but not not_a_predicate/2.
EDIT: disabled while I try to figure out this issue
Hm…but looking at this now, there seem to be maybe a race condition, since the checking happens asynchronously; some more investigation will be required
It’s a component that’s been added to the existing themes. I think if you refresh, it should be active if you’re using the Light or Dark theme (Eric was saying that it doesn’t apply to the Default theme, so that might not work).
There are what I call two types of themes, primary themes that a user selects and component themes that can be included in a primary theme.
What James is doing is to take the exiting component theme and enhance it. Then the component theme is manually included in selected primary themes. If the component theme is included in all the themes then everyone gets the ability of the component theme by default.
As I write this I see that James did add the enhanced component theme to both the Dark, Light and the Neutral primary themes but the earlier component theme needs to be removed.
I put a second pair of eyes on the change, the component theme (discourse-linkify-prolog-predicates) is included in Light, Dark and Neutral.
AFAIK the Default theme no longer exist as a primary theme that can be selected by users. When I did this the option to select Default disappeared.
EDIT
I just did a quick check and the component theme James added is working on multiple themes, retains the basic functionality of Linkify words in post now has the ablity to link to SWI-Prolog documentation when predicate indicators are used.
I removed the older component theme that is no longer needed and expected to see three primary themes each with three component themes, but the Light theme is only showing two, but in checking the settings it is showing three.
Can you also check to see if the Neutral has the same problem? I think Neutral was not really working. Definitely the Dark theme is working though. Good work James.