Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix formatting of multiline codeblocks is broken #18871

Closed
sumnerevans opened this issue Sep 2, 2021 · 3 comments
Closed

Nix formatting of multiline codeblocks is broken #18871

sumnerevans opened this issue Sep 2, 2021 · 3 comments
Labels
A-Timeline O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect X-Cannot-Reproduce

Comments

@sumnerevans
Copy link

Steps to reproduce

Send a message with the following content to a room:

```nix
{
  foo = ''
    bar
  '';
}
```

What happened?

image

What did you expect?

I expect that the code block is shown correctly.

Operating system

NixOS

Application version

Element version: 1.8.2, Olm version: 3.2.3

How did you install the app?

NixOS/nixpkgs#136311

Homeserver

sumnerevans.com

Have you submitted a rageshake?

No

@SimonBrandner SimonBrandner added A-Timeline Help Wanted Extra attention is needed O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist labels Sep 2, 2021
@germain-gg germain-gg removed the Help Wanted Extra attention is needed label Sep 2, 2021
@robintown
Copy link
Member

I cannot reproduce - could you paste the event's source, and also check whether "automatic language detection for syntax highlighting" is enabled in your preferences?

@sumnerevans
Copy link
Author

I do have "Enable automatic language detection for syntax highlighting" on, but it also persists when it's disabled.

Here is the decrypted source for the message:

{
  "room_id": "!MahzEgrijBRaMQLBRS:matrix.org",
  "type": "m.room.message",
  "content": {
    "m.new_content": {
      "msgtype": "m.text",
      "body": "```nix\n{\n  foo = ''\n    bar\n  '';\n}\n```",
      "format": "org.matrix.custom.html",
      "formatted_body": "<pre><code class=\"language-nix\">{\n  foo = ''\n    bar\n  '';\n}\n</code></pre>\n"
    },
    "msgtype": "m.text",
    "body": " * ```nix\n{\n  foo = ''\n    bar\n  '';\n}\n```",
    "format": "org.matrix.custom.html",
    "formatted_body": " * <pre><code class=\"language-nix\">{\n  foo = ''\n    bar\n  '';\n}\n</code></pre>\n"
  }
}

@robintown
Copy link
Member

Fixed by matrix-org/matrix-react-sdk#6681 (I mistakenly thought that this fix was already in 1.8.2, hence my confusion)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Timeline O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect X-Cannot-Reproduce
Projects
None yet
Development

No branches or pull requests

4 participants