I want to try and implement a shortlink system, but I’m not sure where to start. I’m fairly sure I can do it with Space Script, but I’d like a pointer.
For a simpler starting point, in the spirit of the wonderful https://www.sansbullshitsans.com/, how would I go about implementing the following:
- Each time the word
unicorn
appears in markdown, instead render it ashorse
. - Same, but render it as
[horse](http://example.com)
(ideally I’d like to specify markdown and have it be rendered, which would make it easier for this to be extensible). - Same, but not if it’s inside a code block
These should be done without modifying the underlying markdown file.
Any ideas? Just messing around with the Javascript console I ran this:
document.body.innerHTML = document.body.innerHTML.replace(/unicorn/g, "horse");
…silverbullet did not like that, the document became uneditable.