# Code highlights prevent the placeholder value from being displayed in a codeblock

**URL:** https://meta.discourse.org/t/code-highlights-prevent-the-placeholder-value-from-being-displayed-in-a-codeblock/386574
**Category:** Feature
**Tags:** pr-welcome, placeholder-forms
**Created:** [October 23, 2025, 8:18pm UTC](https://meta.discourse.org/t/code-highlights-prevent-the-placeholder-value-from-being-displayed-in-a-codeblock/386574 "2025-10-23T20:18:04Z")
**Posts on this page:** 3
**Page:** 1

<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: [October 23, 2025, 8:18pm UTC](https://meta.discourse.org/t/code-highlights-prevent-the-placeholder-value-from-being-displayed-in-a-codeblock/386574/1 "2025-10-23T20:18:04Z")

</div>

I struggled with this issue for the last days before figuring out what the issue was. It was reported here: [Placeholder Forms - #48 by jericson](https://meta.discourse.org/t/placeholder-forms/113533/48).

The issue doesn’t seem to happen (anymore?) on the example given in the linked post, so I’ll do my own repro here:

````txt
[wrap=placeholder key=TABLE description="table name" default="users"][/wrap]

```
SELECT * FROM =TABLE=;
```

````

does:

```plaintext
SELECT * FROM =TABLE=;

```

The variable isn’t recognized because of the codeblock highlight, which is automatically set to SQL.

The output HTML is:

```html
<code class="hljs language-sql" data-highlighted="yes">
  <span class="hljs-keyword">SELECT</span>
  <span class="hljs-operator">*</span>
  <span class="hljs-keyword">FROM</span>
  <span class="hljs-operator">=</span>
  <span class="hljs-keyword">TABLE</span>
  <span class="hljs-operator">=</span>
  ;
</code>

```

If I specify `txt` in the codeblock, then the value is correctly displayed:

```txt
SELECT * FROM =TABLE=;

```

The expected behavior would be to have the value displayed regardless of the code highlight.

---

<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: [October 24, 2025, 11:52am UTC](https://meta.discourse.org/t/code-highlights-prevent-the-placeholder-value-from-being-displayed-in-a-codeblock/386574/2 "2025-10-24T11:52:24Z")

</div>

I don’t know why the codeblock isn’t automatically set to SQL as it was the case yesterday. It renders my repro ineffective, but it works on [try.discourse.org](http://try.discourse.org) so here’s a screenshot:

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

Regardless of the auto language detection, the fact is that some language highlights will break the string `=VALUE=` and the value won’t be rendered, which is unwanted.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [October 26, 2025, 9:55pm UTC](https://meta.discourse.org/t/code-highlights-prevent-the-placeholder-value-from-being-displayed-in-a-codeblock/386574/3 "2025-10-26T21:55:26Z")

</div>

A fix here is going to be quite complicated, if placeholder markers are parsed as syntax highlighted sections, when we head over to replace we do not find them.

The correct way of sorting this is to redo the pipeline and only do highlighting after we do replacement.

For now I would say this is in the feature request department, I don’t mind putting a pr-welcome on this in case someone can come up with a cheap and simple way of sorting this out.
