Ah yes, I misunderstood, but good point. This component (not a plugin) only performs rendering of the cooked html of the post on the client using jscript, so it doesn’t actually change the raw post.
But there is still the issue of links entered in the raw post and this is where this part comes in
which means some magic will be need to be performed directly on the server to replace both direct links https://suttacentral.net/*
as well as markdown []()
and html <a href>
ones.
Luckily this can be accomplished with some clever regex find and replace from the server console, which will have to be done manually.
Bhante @Sujato, for the newly pasted links it would be ideal if SuttaCentral could provide the correct OpenGraph metadata for Title and Canonical, which would enable Discourse to automatically onebox them correctly like this https://discourse.suttacentral.net/t/automatically-linking-up-citations-to-suttas-on-d-d/25637/11
→ Automatically linking up citations to suttas on D&D - #11 by Snowbird instead of this https://suttacentral.net/mn1/en/sujato
→ SuttaCentral
Then we could have the best combination of entering direct short notation (DN 1 or dn1) into raw post and it would both be renderd as a linkified DN1 using Linkify component and
suttacentral.net
→ SuttaCentral
suttacentral.net\dn
→ Digha Nikaya (or SuttaCentral—Digha Nikaya)
suttacentral.net\dn1
→ DN 1 (or DN1 or dn1 or SuttaCentral—DN 1)
suttacentral.net\dn1\en\sujato
→ DN 1 by Sujato (or SuttaCentral—DN 1 by Sujato)
which would be linkified using native Discourse oneboxing.
One benefit of fixing the OpenGraph metadata would be that the find/ replace of the text in historical posts wouldn’t be required, as it would automatically fix itself by much simpler rebaking.
Ideally this would also be fixed by setting the correct metadata:
https://suttacentral.net/mn1/en/sujato#mn1:171.4
and you wouldn’t even need to construct the markdown manually, because this link will automatically render as inline onebox with the correct title MN1:171.4
We can of course choose which historical posts to fix or leave as is.
OpenGraph metadata can be checked with http://debug.iframely.com