# Linking to Custom Scheme

**URL:** <https://meta.discourse.org/t/linking-to-custom-scheme/254729>\
**Category:** Development\
**Created:** [February 10, 2023, 3:39am UTC](https://meta.discourse.org/t/linking-to-custom-scheme/254729 "2023-02-10T03:39:03Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jays10](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@jays10](https://meta.discourse.org/u/jays10)\
**Post date:** [February 10, 2023, 3:39am UTC](https://meta.discourse.org/t/linking-to-custom-scheme/254729/1 "2023-02-10T03:39:03Z")

</div>

Hello All,

We are setting up our new discourse internal environment and I was able to setup a custom URL scheme to link to an internal resource on the network, I wanted to add an easy button when making a new post which I was able to do but I want to be able to use the highlighted text for the link title as well as for the actual link itself. Right now I am just using an apply surround to insert what we need into a link but we have to manually change the link title, see the code below.

```plaintext
<script type="text/discourse-plugin" version="1.0">
api.onToolbarCreate(toolbar => {
    toolbar.addButton({
        id: "dms_button",
        group: "fontStyles",
        icon: "fab-wikipedia-w",
        perform: e => e.applySurround("[id_here](INET://", ')')
    });
});
</script>

```

user enters 123456 \> that applies this around the highlighted text `[id_here](INET://123456)`

I did look through the code but I could not find anything that would help me accomplish what we are looking to do. Is there anyway to use the highlighted text in the link title as well?

---

_[View the full topic](https://meta.discourse.org/t/linking-to-custom-scheme/254729)._
