Unexpected Line Breaks in TOML Codeblocks in Reading View
When using the Obsidian Copilot plugin, TOML files displayed in Reading View exhibit unexpected line breaks. This issue disrupts the readability and formatting of TOML files, making it difficult to review or edit configurations.
Steps to Reproduce:
- Install and enable plugin in Obsidian.
- Write a toml codeblock.
- Switch to Reading View.
- Observe the unexpected line breaks in the TOML file content.
Expected Behavior:
Actual Behavior:
Environment:
- Obsidian Version: 1.8.7
- Copilot Version: 2.8.6
- Operating System: Windows 11 and MacOS
What do you mean, is this toml code block generated from the copilot view? Or is it something you wrote in your note? I don't see any relation to Copilot from your description.
Or is it something you wrote in your note?
Here it is: @logancyang
https://github.com/user-attachments/assets/c82287f0-f611-43d5-bf9f-4df66ce7ac4d
I have the same issue.
Only when Copilot plugin is enabled, all toml code blocks have this rendering issue. Code block generated by Copilot and code blocks written by the user. But only if they start with ```toml
To reproduce:
Create a new note, add this content:
```toml
[foo]
```
The issue does not appear with this:
```
[foo]
```
I guess it is related to "table", because [foo] is called a table in markdown.
You can see the issue appear/disappear when toggling Copilot plugin
https://github.com/user-attachments/assets/8bf0ee5e-84ca-4e03-85a6-9606ea13a141
The issue happens when Copilot generates toml too. If you ask gtp-4o "Print Cargo.toml example" it adds toml after the triple backticks under the hood: you do not see it, but it renders with the same issue. If you ask "Print Cargo.toml, do not specify toml in code block" it prints without syntax highlight and without the issue
If I remove .table{display:table} from .obsidian/plugins/copilot/style.css, the issue is fixed.
This seems to be fixed by version 2.9.0, .table{display:table} is not in style.css and toml looks good.
Probably fixed by https://github.com/logancyang/obsidian-copilot/commit/972b63d002c15d7ae58b4155e0245c7451e4158d
@logancyang I think this can be closed. After updating to 2.9.0 this issue is fixed.