# Plugin dev pointers needed: re-formatting links as buttons

**URL:** https://meta.discourse.org/t/plugin-dev-pointers-needed-re-formatting-links-as-buttons/76750
**Category:** Development
**Created:** [December 25, 2017, 11:58pm UTC](https://meta.discourse.org/t/plugin-dev-pointers-needed-re-formatting-links-as-buttons/76750 "2017-12-25T23:58:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sjd333](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sjd333/32/120439_2.png) [@sjd333](https://meta.discourse.org/u/sjd333)
#### Post date: [December 25, 2017, 11:58pm UTC](https://meta.discourse.org/t/plugin-dev-pointers-needed-re-formatting-links-as-buttons/76750/1 "2017-12-25T23:58:48Z")

</div>

Hi,

I’m looking for some high-level guidance on approach to building a link formatting plugin.

The plugin should automatically display links to a particular web resource (matching a given regular expression) as a button.

Essentially, when someone includes a URL in a post matching a specific pattern, like this:

```plaintext
http://mysite.domain/specific/path/

```

…the post should appear as if they had used the following markdown:

```plaintext
[![Foo](my-button.png)](http://mysite.domain/specific/path)

```

I’m not sure at what point in the code I should be performing my link identification RegEx and modifying the output.

Should I be doing this through a…

- Dialect?
- Linkify rules extension/schema?
- Markdown-it text replacement?  
(md.core.textPostProcess.ruler)
- Nokogiri link extraction and modification?

Appreciate if someone could point me in the right direction.

Thanks

Sam

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [December 26, 2017, 12:07am UTC](https://meta.discourse.org/t/plugin-dev-pointers-needed-re-formatting-links-as-buttons/76750/2 "2017-12-26T00:07:18Z")

</div>

Hi sjd333 welcome to the forum

If all you want to to do is style certain links, all you need to do can be done with CSS

> **[Attribute selectors - CSS | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Attribute_selectors)**
>
> The CSS attribute selector matches elements based on the element having a given attribute explicitly set, with options for defining an attribute value or substring value match.

---

<div class="post-metadata">

### Author: ![sjd333](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sjd333/32/120439_2.png) [@sjd333](https://meta.discourse.org/u/sjd333)
#### Post date: [December 26, 2017, 12:14am UTC](https://meta.discourse.org/t/plugin-dev-pointers-needed-re-formatting-links-as-buttons/76750/3 "2017-12-26T00:14:20Z")

</div>

Oh, fantastic! Thanks for getting back to me. That is a much simpler route to go down, so will go with that. Will report back once I’m done case I can help someone to achieve a similar result.

Best,

Sam
