# Space Script: Modifying rendering?

**URL:** https://community.silverbullet.md/t/space-script-modifying-rendering/1082
**Category:** Tricks & Techniques
**Created:** [October 1, 2024, 9:30pm UTC](https://community.silverbullet.md/t/space-script-modifying-rendering/1082 "2024-10-01T21:30:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lutzky](https://community.silverbullet.md/user_avatar/community.silverbullet.md/lutzky/32/624_2.png) [@lutzky](https://community.silverbullet.md/u/lutzky)
#### Post date: [October 1, 2024, 9:30pm UTC](https://community.silverbullet.md/t/space-script-modifying-rendering/1082/1 "2024-10-01T21:30:46Z")

</div>

I want to try and implement a [shortlink system](https://community.silverbullet.md/t/support-for-shortlinks/1052), 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/](https://www.sansbullshitsans.com/), how would I go about implementing the following:

1. Each time the word `unicorn` appears in markdown, instead render it as `horse`.
2. 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).
3. 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:

```javascript
document.body.innerHTML = document.body.innerHTML.replace(/unicorn/g, "horse");

```

…silverbullet did _not_ like that, the document became uneditable.

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [October 3, 2024, 4:27pm UTC](https://community.silverbullet.md/t/space-script-modifying-rendering/1082/2 "2024-10-03T16:27:13Z")

</div>

You can’t realistically do this. To change the rendering inside CodeMirror you either have to build a CM plugin as part of the SilverBullet core, or you have to leverage some of the infrastructure that exist for creating custom renderers you can build for custom fenced code blocks, like the [GitHub - silverbulletmd/silverbullet-mermaid: Mermaid support for Silver Bullet](https://github.com/silverbulletmd/silverbullet-mermaid) plug does (as a plug, but you _could_ achieve something like this in space script if you really put your mind to it).
