Code block parsing is less forgiving than Discord about whitespace around the fences

(#608) Bug Needs triage markdown

Summary

Fluxer does not render text inside code blocks correctly in most cases where there's no whitespace after the close mark, resulting in bad rendering, for example, as shown in the image: image The expected behaviour is for a single "Text" line to be rendered before, inside, and after the code block. Amount of spacing around the code block may differ (as is the case on Discord), but I'd expect the text itself to render as described. NOTE: This is a repost of #138 with updated screenshots - I can still reproduce the issue (including all the test results listed below) after the Fluxer V2 release, though the code block part is now no longer rendered as a code block at all (i.e. it's rendered exactly as written, with no formatting).

Steps to reproduce

  1. Send a message with the following content:
    Text```
    Text
    ```Text
    
  2. See the issue (as seen in the image above; note: in some failing variations, the code block may render differently from the screenshot, but still not in the expected way).
Below you can find a complete list of all 16 variations of the following variables:
  • Whitespace before open
  • Whitespace after open
  • Whitespace before close
  • Whitespace after close
8 out of 16 renders correctly on Fluxer. 16 out of 16 renders correctly on Discord. "renders correctly" means it gives the expected behaviour, as described in the previous section. Test results for all 16 combinations.
  1. ✅ Works
    • Whitespace before open: No
    • Whitespace after open: No
    • Whitespace before close: No
    • Whitespace after close: No
Text```Text```Text
  1. ✅ Works
    • Whitespace before open: No
    • Whitespace after open: No
    • Whitespace before close: No
    • Whitespace after close: Yes
Text```Text```
Text
  1. ❌ Does NOT work
    • Whitespace before open: No
    • Whitespace after open: No
    • Whitespace before close: Yes
    • Whitespace after close: No
Text```Text
```Text
  1. ❌ Does NOT work
    • Whitespace before open: No
    • Whitespace after open: No
    • Whitespace before close: Yes
    • Whitespace after close: Yes
Text```Text
```
Text
  1. ❌ Does NOT work
    • Whitespace before open: No
    • Whitespace after open: Yes
    • Whitespace before close: No
    • Whitespace after close: No
Text```
Text```Text
  1. ✅ Works
    • Whitespace before open: No
    • Whitespace after open: Yes
    • Whitespace before close: No
    • Whitespace after close: Yes
Text```
Text```
Text
  1. ❌ Does NOT work
    • Whitespace before open: No
    • Whitespace after open: Yes
    • Whitespace before close: Yes
    • Whitespace after close: No
Text```
Text
```Text
  1. ✅ Works
    • Whitespace before open: No
    • Whitespace after open: Yes
    • Whitespace before close: Yes
    • Whitespace after close: Yes
Text```
Text
```
Text
  1. ✅ Works
    • Whitespace before open: Yes
    • Whitespace after open: No
    • Whitespace before close: No
    • Whitespace after close: No
Text
```Text```Text
  1. ✅ Works
    • Whitespace before open: Yes
    • Whitespace after open: No
    • Whitespace before close: No
    • Whitespace after close: Yes
Text
```Text```
Text
  1. ❌ Does NOT work
    • Whitespace before open: Yes
    • Whitespace after open: No
    • Whitespace before close: Yes
    • Whitespace after close: No
Text
```Text
```Text
  1. ❌ Does NOT work
    • Whitespace before open: Yes
    • Whitespace after open: No
    • Whitespace before close: Yes
    • Whitespace after close: Yes
Text
```Text
```
Text
  1. ❌ Does NOT work
    • Whitespace before open: Yes
    • Whitespace after open: Yes
    • Whitespace before close: No
    • Whitespace after close: No
Text
```
Text```Text
  1. ✅ Works
    • Whitespace before open: Yes
    • Whitespace after open: Yes
    • Whitespace before close: No
    • Whitespace after close: Yes
Text
```
Text```
Text
  1. ❌ Does not work
    • Whitespace before open: Yes
    • Whitespace after open: Yes
    • Whitespace before close: Yes
    • Whitespace after close: No
Text
```
Text
```Text
  1. ✅ Works
    • Whitespace before open: Yes
    • Whitespace after open: Yes
    • Whitespace before close: Yes
    • Whitespace after close: Yes
Text
```
Text
```
Text

Environment

Canary Web 2026.605.11941, Linux (x86), Chrome 149.0.0.0, Locale en-US

Logs or screenshots

Already posted in summary.
  • 550625618-7bb3e7a3-fdad-4582-8e38-b061b3bd0de2.png

    550625618-7bb3e7a3-fdad-4582-8e38-b061b3bd0de2.png

    365×178 | 9 kB

Merged posts

These posts were merged into this one. Their comments are now part of the conversation below, marked with where they came from.

Report details

Summary

Fluxer does not render text inside code blocks correctly in most cases where there's no whitespace after the close mark, resulting in bad rendering, for example, as shown in the image: image The expected behaviour is for a single "Text" line to be rendered before, inside, and after the code block. Amount of spacing around the code block may differ (as is the case on Discord), but I'd expect the text itself to render as described.

Steps to reproduce

  1. Send a message with the following content:
    Text```
    Text
    ```Text
    
  2. See the issue (as seen in the image above; note: in some failing variations, the code block may render differently from the screenshot, but still not in the expected way).
Below you can find a complete list of all 16 variations of the following variables:
  • Whitespace before open
  • Whitespace after open
  • Whitespace before close
  • Whitespace after close
8 out of 16 renders correctly on Fluxer. 16 out of 16 renders correctly on Discord. "renders correctly" means it gives the expected behaviour, as described in the previous section. Test results for all 16 combinations.
  1. ✅ Works
    • Whitespace before open: No
    • Whitespace after open: No
    • Whitespace before close: No
    • Whitespace after close: No
Text```Text```Text
  1. ✅ Works
    • Whitespace before open: No
    • Whitespace after open: No
    • Whitespace before close: No
    • Whitespace after close: Yes
Text```Text```
Text
  1. ❌ Does NOT work
    • Whitespace before open: No
    • Whitespace after open: No
    • Whitespace before close: Yes
    • Whitespace after close: No
Text```Text
```Text
  1. ❌ Does NOT work
    • Whitespace before open: No
    • Whitespace after open: No
    • Whitespace before close: Yes
    • Whitespace after close: Yes
Text```Text
```
Text
  1. ❌ Does NOT work
    • Whitespace before open: No
    • Whitespace after open: Yes
    • Whitespace before close: No
    • Whitespace after close: No
Text```
Text```Text
  1. ✅ Works
    • Whitespace before open: No
    • Whitespace after open: Yes
    • Whitespace before close: No
    • Whitespace after close: Yes
Text```
Text```
Text
  1. ❌ Does NOT work
    • Whitespace before open: No
    • Whitespace after open: Yes
    • Whitespace before close: Yes
    • Whitespace after close: No
Text```
Text
```Text
  1. ✅ Works
    • Whitespace before open: No
    • Whitespace after open: Yes
    • Whitespace before close: Yes
    • Whitespace after close: Yes
Text```
Text
```
Text
  1. ✅ Works
    • Whitespace before open: Yes
    • Whitespace after open: No
    • Whitespace before close: No
    • Whitespace after close: No
Text
```Text```Text
  1. ✅ Works
    • Whitespace before open: Yes
    • Whitespace after open: No
    • Whitespace before close: No
    • Whitespace after close: Yes
Text
```Text```
Text
  1. ❌ Does NOT work
    • Whitespace before open: Yes
    • Whitespace after open: No
    • Whitespace before close: Yes
    • Whitespace after close: No
Text
```Text
```Text
  1. ❌ Does NOT work
    • Whitespace before open: Yes
    • Whitespace after open: No
    • Whitespace before close: Yes
    • Whitespace after close: Yes
Text
```Text
```
Text
  1. ❌ Does NOT work
    • Whitespace before open: Yes
    • Whitespace after open: Yes
    • Whitespace before close: No
    • Whitespace after close: No
Text
```
Text```Text
  1. ✅ Works
    • Whitespace before open: Yes
    • Whitespace after open: Yes
    • Whitespace before close: No
    • Whitespace after close: Yes
Text
```
Text```
Text
  1. ❌ Does not work
    • Whitespace before open: Yes
    • Whitespace after open: Yes
    • Whitespace before close: Yes
    • Whitespace after close: No
Text
```
Text
```Text
  1. ✅ Works
    • Whitespace before open: Yes
    • Whitespace after open: Yes
    • Whitespace before close: Yes
    • Whitespace after close: Yes
Text
```
Text
```
Text

Environment (optional)

stable (d90628a), 2026-02-16 10:10:38 UTC, Electron 39.2.7, Linux 5.15.0-170-generic (x64), desktop stable 0.0.8

Logs or screenshots (optional)

Already posted in summary.
  • 550625618-7bb3e7a3-fdad-4582-8e38-b061b3bd0de2.png

    550625618-7bb3e7a3-fdad-4582-8e38-b061b3bd0de2.png

    365×178 | 9 kB

2 comments

Sign in with Fluxer to comment and vote.
Comment by @Jackenmen
RexSystem 1 vote Merged from #138 originally by @Jackenmen on GitHub OP
Another strange occurrence:
{
    "content": "**Text:\n**
\ntest\n
"
}
gives: image
  • 551890362-ebdcaec8-0bfb-48c6-822c-d93236604b8f.png

    551890362-ebdcaec8-0bfb-48c6-822c-d93236604b8f.png

    1389×185 | 14 kB

Comment by @Jackenmen
RexSystem 1 vote edited Merged from #138 originally by @Jackenmen on GitHub OP
Can still reproduce (with slightly different, but still incorrect, rendering), recreated at #608
Deleted comment
Removed by moderator Rex: Removed a general status note that was posted on many GitHub threads. It no longer applies here.