# Unformatted Code Detector

**URL:** https://meta.discourse.org/t/unformatted-code-detector/112773
**Category:** Theme component
**Tags:** official, unformatted-code-detector
**Created:** [March 28, 2019, 4:21am UTC](https://meta.discourse.org/t/unformatted-code-detector/112773 "2019-03-28T04:21:55Z")
**Posts on this page:** 13
**Page:** 2

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 28, 2021, 8:54pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/50 "2021-10-28T20:54:46Z")

</div>

It depends how much the rules can be edited; I’m unclear how the rules are edited. Can you clarify a bit @david in the first post?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [October 28, 2021, 9:36pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/51 "2021-10-28T21:36:33Z")

</div>

I’m afraid at the moment the rules can’t be edited. The sensitivity can be adjusted, and html detection can be turned on/off.

> [@hhlp](#):
>
> - Logs
> - Linux Command CLI
> - Terminal Output

There are some built-in rules which should help with these. If you’d like to try it out, try posting some code in a PM to yourself here on Meta.

However, I think the example you posted is unlikely to be detected, since it doesn’t contain any special characters or timestamps which match our detection patterns.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 28, 2021, 9:48pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/52 "2021-10-28T21:48:23Z")

</div>

The original vision I had was for a component where you could specify how much “energy” a given character (or complete string, such as `C:\`) adds, especially as that character (or string) begins repeating in the same nearby area over and over, multiplying the code energy score.

```plaintext
Sensors:
  System Temperatures: cpu: 78.0 C mobo: 36.0 C gpu: nouveau temp: 56.0 C 
  Fan Speeds (RPM): cpu: 0 fan-1: 3139 fan-3: 0 fan-5: 0 
  Power: 12v: N/A 5v: 2.90 3.3v: N/A vbat: 3.34 

```

This is rather colon heavy. So ideally if you wanted to tweak this, you’d set an energy level for the colon, and a repetition bonus.

I guess that is not possible at the moment, it is unfortunate all the rules are hard-coded.

---

<div class="post-metadata">

### Author: ![thess](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thess/32/121467_2.png) [@thess](https://meta.discourse.org/u/thess)
#### Post date: [January 18, 2022, 11:50pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/54 "2022-01-18T23:50:35Z")

</div>

Just to clarify @tmomas’s note - We use a custom version of this plugin with some additional code-matching patterns not in the stock version. We also added a bit of user-interface to add (albeit unchecked and with much caution), custom regex patterns. Refs:

- [Github Pull-Request to add regex](https://github.com/discourse/unformatted-code-detector/pull/38).
- [Our repo branch here](https://github.com/thess/unformatted-code-detector/commits/openwrt-forum-mods)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 30, 2024, 3:06pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/61 "2024-07-30T15:06:38Z")

</div>

11 posts were split to a new topic: [Can the Unformatted Code Detector be disabled per user?](https://meta.discourse.org/t/can-the-unformatted-code-detector-be-disabled-per-user/319263)

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [November 18, 2025, 7:58pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/62 "2025-11-18T19:58:45Z")

</div>

There is an error referencing this component in my browser console:

> [THEME 230 ‘Unformatted Code Detector’] Attempted to modify “service:composer”, but it was already initialized earlier in the boot process (e.g. via a lookup()). Remove that lookup, or move the modifyClass call earlier in the boot process for changes to take effect. [Using modifyClass to change core behavior](https://meta.discourse.org/t/262064)

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/1/1/611df43193bf91fcc2403e31307bca2e53d5fe72.png)

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [November 19, 2025, 2:26pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/63 "2025-11-19T14:26:39Z")

</div>

Thanks @Moin , we are aware of this, it has already been reported internally and is scheduled to be updated as soon as possible.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 21, 2025, 4:32pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/65 "2025-11-21T16:32:06Z")

</div>

Thanks for the reports! This should be resolved following this core change

[https://github.com/discourse/discourse/commit/d2f5f96478b0c67629ddb1052333d071b5f48e08](https://github.com/discourse/discourse/commit/d2f5f96478b0c67629ddb1052333d071b5f48e08)

---

<div class="post-metadata">

### Author: ![patrickemin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickemin/32/520162_2.png) [@patrickemin](https://meta.discourse.org/u/patrickemin)
#### Post date: [May 24, 2026, 2:54pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/67 "2026-05-24T14:54:07Z")

</div>

Hi this error message displays when accessing this component on my site:

Error cloning the Git repository: access is denied or the repository cannot be found.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [May 24, 2026, 3:02pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/68 "2026-05-24T15:02:00Z")

</div>

Does the "Source " link work when you click it?

Does clicking Check for updates help?

 ![Screenshot_20260524_165805_Firefox](https://global.discourse-cdn.com/meta/original/4X/6/8/4/684bb4e6a93878aab12a3c54d13d73d056f9f841.jpeg)

---

<div class="post-metadata">

### Author: ![patrickemin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickemin/32/520162_2.png) [@patrickemin](https://meta.discourse.org/u/patrickemin)
#### Post date: [May 24, 2026, 3:03pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/69 "2026-05-24T15:03:52Z")

</div>

Yes actualy both are working, don’t know why I had this message…

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [May 24, 2026, 3:10pm UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/70 "2026-05-24T15:10:12Z")

</div>

Maybe you were [rate limited](https://meta.discourse.org/t/discourse-2026-3-0-latest-1-all-themes-reporting-a-error-cloning-git-repository-access-is-denied-or-repository-is-not-found-error/399003/6) by GitHub 🤷‍♀️ I think as long as the error disappears on the next try to access the repository there is nothing to worry about.

---

<div class="post-metadata">

### Author: ![Noble\_Fish](https://avatars.discourse-cdn.com/v4/letter/n/ad7895/32.png) [@Noble\_Fish](https://meta.discourse.org/u/Noble_Fish)
#### Post date: [July 4, 2026, 8:17am UTC](https://meta.discourse.org/t/unformatted-code-detector/112773/71 "2026-07-04T08:17:02Z")

</div>

Can a list be added to allow detection of code of specific syntax types? This would help narrow down the scope of judgment to be more precise and reduce false positives, and some forums for non-professional programmers may not necessarily need overly general checks; for example, some modding forums for old games might only use INI code snippets and CPP code snippets.

[Previous page](https://meta.discourse.org/t/unformatted-code-detector/112773.md?page=1)
