# Add markdown to selected text

**URL:** https://meta.discourse.org/t/add-markdown-to-selected-text/357385
**Category:** Feature
**Tags:** composer
**Created:** [March 15, 2025, 9:38am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385 "2025-03-15T09:38:14Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 15, 2025, 9:38am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/1 "2025-03-15T09:38:14Z")

</div>

I don’t know if this is possible at all, but for example in Obsidian I am able to select a word or sentence and then hit the backtick to automatically surround the word or sentence with a backtick (or 3 backticks for code).

Would this possible to implement here? I find myself trying this quite often, because of my extensive use of it in Obsidian.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 15, 2025, 9:48am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/2 "2025-03-15T09:48:35Z")

</div>

Sorry, you can’t. But you can select piece of text and then open the cog from toolbar and choose the first one (mine speaks Finnish… is it preformatted or something) and then it uses one tick inline and three ticks for a chapter.

Matter of taste, but adding ticks using old way is much more faster.

So, this is a feature request indeed.

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 15, 2025, 9:55am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/3 "2025-03-15T09:55:04Z")

</div>

My cogwheel doesn’t have that

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/2/e/92ec9e359121a315d9a231d7db5c893d57b5b75d.png)

But the default toolbar does have the Placeholder, which adds the single backtick, which is already good, along with the CMD+E shortcut.

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/a/4/0a41a60cc5fd052edbd71c2ed99edb5be67c27b4.png)

Is the toolbar and cogwheel customizable, maybe?

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 15, 2025, 10:01am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/4 "2025-03-15T10:01:17Z")

</div>

We can’t format anything here. Same button, though. But I don’t know why you have it in the toolbar and I have it inside the cog 🤷‍♂️

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 15, 2025, 10:35am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/5 "2025-03-15T10:35:08Z")

</div>

And why do you have the Chapter option and I don’t? 😕

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 15, 2025, 10:38am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/6 "2025-03-15T10:38:47Z")

</div>

Because I didn’t try it. I only assumed so because without selected text it uses three ticks.

`But I was totally wrong.`

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [March 15, 2025, 10:39am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/7 "2025-03-15T10:39:20Z")

</div>

> [@alltiagocom](#):
>
> And why do you have the Chapter option and I don’t? 😕

The correct names are inline code and code block.

``inline code``

````plaintext
```
code block
```

````

There’s a single button (and shortcut) for both preformatted text types.

If you haven’t selected any text, it will create an inline code.  
If your selection is no more than 1 line, it will create an inline code.  
If your selection contains a line break, it will create a code block.

> [@alltiagocom](#):
>
> Is the toolbar and cogwheel customizable, maybe?

As far as I know, and unfortunately, not from the interface.  
See:

> [@How to customize the composer toolbar?](https://meta.discourse.org/t/how-to-customize-the-composer-toolbar/323577/3):
>
> There’s no setting to configure the toolbar, but it’s possible through themes and plugins. It would be nice to have this feature, so I’m going to re-categorize it as a feature request. For now, buttons can be hidden with CSS… for example: .d-editor-button-bar { .local-dates { // hides the date button display: none; } } or to hide an option from the gear menu .toolbar-popup-menu-options { [data-name="Build Poll"] { display: none; } } With CSS it’s also fairly straightforw…

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 15, 2025, 10:40am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/8 "2025-03-15T10:40:50Z")

</div>

Really?

```plaintext
I didn`t know that line break thingy.
Everyday something new.

```

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 15, 2025, 10:41am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/9 "2025-03-15T10:41:09Z")

</div>

Thanks for clarifying on both the correct names and how it works!

I just tested your 3 options and it works. Great! 🙂

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [March 15, 2025, 10:41am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/10 "2025-03-15T10:41:55Z")

</div>

There’s a #Documentation topic about the code formatting:

> [@Posting code or preformatted text](https://meta.discourse.org/t/posting-code-or-preformatted-text/188910):
>
> bookmark This guide explains how to post code or preformatted text in Discourse using Markdown, BBCode, and HTML formats. person_raising_hand Required user level: All users Have a line of code you need to share? Maybe you need to share an error log from your site? Reading unformatted code can be challenging, especially if the code depends on spacing or contains special characters that Discourse transforms. Summary In this guide, you’ll learn: How to format inline code. How to format …

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 15, 2025, 10:44am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/11 "2025-03-15T10:44:59Z")

</div>

Thanks for sharing this page.  
I like the option of using `text` as the language to avoid formatting. I didn’t know that.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [March 15, 2025, 10:52am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/12 "2025-03-15T10:52:30Z")

</div>

> [@alltiagocom](#):
>
> I like the option of using `text` as the language to avoid formatting. I didn’t know that.

You can set the default language in your admin settings 👍

Any unrecognized string will act like “text”, since “text” basically means “no highlights”.

Unless I’m wrong,

````plaintext
```anything

```

````

is the same as

````plaintext
```txt

```

````

or

````plaintext
```text

```

````

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 15, 2025, 10:53am UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/13 "2025-03-15T10:53:44Z")

</div>

I see. Makes sense.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 15, 2025, 10:18pm UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/14 "2025-03-15T22:18:56Z")

</div>

> [@alltiagocom](#):
>
> I am able to select a word or sentence and then hit the backtick to automatically surround the word or sentence with a backtick (or 3 backticks

You can select code and type control-e to surround it with backticks, or touch the gear and select reformatted text. Isn’t they what you want?

Oh, but they already told you?

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 16, 2025, 10:05pm UTC](https://meta.discourse.org/t/add-markdown-to-selected-text/357385/15 "2025-03-16T22:05:05Z")

</div>

I used the shortcut a few times now.  
My thing is that I use the ticks a lot in Obsidian, so it’s more about muscle memory of just selecting the word or sentence and hit the backtick key. Obsidian goes a step further with single and double quotes, parenthesis, brackets (curly and square), etc.
