TAB is broken

Sorry, I don’t really know how to describe that behaviour better.

Depending on the mood TAB key can create a code block, indent, fake indent, fake code block (I call them fake because they doesn’t appear in Preview mode, only in Edit).

What was my steps from the beginning:

  1. I did import my Markdown files from Roam.
  2. Converted them with importer in Obsidian.
  3. Noticed this bug.
  4. Created new vault - didn’t help.
  5. Deleted all valts, reinstalled Obsidian - still no luck.

Windows 10, Obsidian 0.9.17, no custom CSS/plugins.

Here is a video.
Thank you.

1 Like

What you’re seeing is the, sadly, expected behavior when indenting normal text: red color stands for code. I have the same issue with my Roam imports, of which half are showing code snippets where none were entered. It would be really helpful to switch code insertion off, if “tab indenting” is switched on in the editor settings. That way the programmers get their part and the writers and outliners as well.

1 Like

Indeed. Roam’s indentation isn’t copacetic with Markdown’s indentation for code syntax, and Markdown is rather picky about arbitrary indentation.

You may want to mass find-and-replace your tabs with more appropriate structures. I believe I did something similar when I imported some Roam notes a long time ago. Use an app with mass find and replace (e.g., VSCode) that recognizes Regex, and e.g., replace all sets of three tabs (\t\t\t, I think; try testing on regexr.com first) with e.g., \t\t- , then \t\t with \t- , then \t with - , etc.

YMMV—be sure to experiment with a subset of notes and make backups before you do this kind of massive editing.

As for Roam importing, feel free to create a feature request to add a “Convert tabs” to the importer plugin.

2 Likes

Oh, okay. So it’s just a misunderstanding from my side. My bad. :blush:
I guess it will take some time to get used to this program. Seems really good but some things are not as intuitive as they are in Roam.
Thank you for replies and suggestions! :slight_smile:

1 Like

No worries. To be clear, Roam uses markdown-like syntax but a lot of things are not quite standard. Markdown’s a well-accepted way of writing these days but if you’re coming from Roam, you’re likely to be confused by the way it’s conventionally done. The syntaxes used in Obsidian are pretty universal, though, and work in e.g., DEVONthink, iA Writer, Typora, 1Writer, GitJournal, etc. etc.

3 Likes

That’s very good to know, as uniformity is key to the file approach to enable working on the Obsidian Vault with other apps. Thanks, @ryanjamurphy!

1 Like

Hi, my first comment here, so trying to be as humble as I can (started using Obsidian yesterday and I feel like a kid exploring it). @ryanjamurphy Could you explain why Markdown behaves this way in Obsidian (as a convention)? I have used markdown for about 5 years, with multiple markdown-editors, and have never experiences this before. Not that I see a reason to (arbitrarily) indent the first line, so its not a problem. Im just really curious why I haven’t seen this happen before. Im not able to recreate it in any of my other editors.

Welcome! Sorry, though, I’m not sure what you’re referring to. What part of Obsidian’s syntax is causing trouble?

1 Like

Sorry, I was unclear. Im only referring to the original comment; that “tabbing” the first line of text turns it into an indented code-block. I was wondering why this is a-feature-and-not-a-bug; why Markdown is made to do this.

Oh, sure, it’s just part of the original specifications:
https://daringfireball.net/projects/markdown/syntax#precode

Like many standards, though, Markdown is not implemented the same everywhere.

1 Like

:pray: Perfect, thanks alot. I’ve read and referenced that page so many times — but never paid attention to codeblocks.

1 Like

Hello all,

I have the same problem with Obsidian 0.15.9 on Ubuntu: I need to write structured notes, not code, and quickly change their outlines. Documentation and video tutorials say that to indent a header, or a list item, you must press TAB. But when I do it, formats that header or list item as a red block of code, and I can’t find, or recognize, any way to turn that behavior off. But I see in videos that people are doing it, so it MUST be possible.

How can I disable code insertion? Or, override it so that at least when I select a header or list item, TAB indents it, and Shift+TAB outdents it?

Thanks!