Line wrap in code blocks

hi,
i searched for this and couldn’t find an answer, please bear with me.

when I paste code into obsidian, i get a scoll bar with wide lines, and the text doesn’t wrap.

I want the text to wrap, cause when I search something, it’s hidden behind the area which needs to be scolled into. that’s impractical for my purpose.

can I enable line wrapping for code blocks?

thanks!

Hi :wave:t4:

Can you give a little more detail on how you are pasting? What theme you are using? Your Obsidian version, etc?

When I create a CSS code block in an Obsidian note and paste in some css using the default theme, it wraps:

```css
.workspace-leaf-content[data-type=recent-files] .view-content .nav-file-title-content {
  font-size: 13px;
  padding-bottom: 6px;
  color: var(--nav-item-color);
} 
```

See the forum code fomatting tips if want to post the code here on the forum.

thanks for looking into it.

  • obsidian 1.2.8 (it’s a non admin computer, i am not sure how I managed to install, upgrading might be tricky.
  • theme is “Blue Topaz”
    i am pasting something like this, and it creates a scrollbar which is impractical for me.
index=prod method=post Id=12345 source="system-prod"
lifecycle=SomeRegistrationProcess clientUsername="system.mydomain.com"
"payload{}.someid"="12345678-1234-1234-1234-12345678" "payload{}.somecriterion{}.granted"=true

I don’t see a scrollbar using the default theme:

Blue Topaz has a lot of settings, you could check in their settings. It could also be another plugin or CSS snippet causing the wrapping. Have a look here for some debug tips:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.