Auto-replace text with link to topic

You don’t need a theme component, this is a built in feature of Discourse now.

Admin → Customize → Watched Words → Replace