Is there a way to simply indent text without having it to turn into a code block and without it becoming ugly red? (non-programmer writer here)

The title says it all. I tried tab and 4 spaces. Everything makes the text a code block. I simply want it to be indented, that’s all. Is that not possible, or am I missing something obvious here? (Sorry if I am. Newbie here.)

6 Likes

This may not be the best solution because it is kind of ugly, but, use this in front of your line. A native markdown solution would be best, but I don’t know of one yet.

$\qquad$ 

$\qquad$The indented line would look like this.

If you come across a better solution, you can always search and replace it.

<ul>
You might can also just use the ul tag. This indents things. 
</ul>

Cheers,

Clif

5 Likes

Thank you @clifton . I like the “/ul” solution. But when I tried to use it all subsequent lines (after the ul mode is closed) in the edit mode look indented, even though they are fine in preview mode. Also if I hit enter after closing out the ul mode the lines appear in red color as if they are a block, even though they appear fine in preview mode. See this as example: http://prntscr.com/1cf0ui8 (left side is edit mode, right side is preview mode). Any idea how to make it less confusing in edit mode since I don’t keep my preview mode on all the time?

Hi @fierce_ninja. I do not have that issue. See here: https://prntscr.com/1cg04y3

I am actually very new to this. I only registered on this forum today and have been using Obsidian for maybe two days. So, I will not be much help beyond this indention issue. I am certainly hoping to learn more, though. I’m running v0.12.10 on Linux Mint. I don’t know if there are any differences in OS version.

Clifton

You could change the text color via css if you wanted. It’s really easy to do.

  1. Look in your vault root file for a folder called “.obsidian” The dot at the beginning of the file name makes it a hidden file so you will have to instruct your file explorer to “show hidden files”. I’m using Ubuntu and I can do it here via the “View” menu in my file explorer window.

  2. Once you have found your .obsidian folder, make a new file in the sub-folder “snippets” and call it something like my_snippets.css (the name doesn’t matter but the “.css” does)

  3. Open your new file with a text editor and copy/paste this little css snippet in there and then save your file.

.cm-s-obsidian span.cm-inline-code{
color: var(–text-normal);
}

  1. Now, go to your obsidian vault Settings > Appearance and in the section called “CSS Snippets” activate your new snippet file.

  2. Close your vault and reopen it and the indented text should be the same color as all your other text.

Or, come to think of it, here is my test file to drop in your .obsidian/snippets file and enable it via Settings > Appearance.normalize_code_blocks.css (70 Bytes)

Hope this helps!

2 Likes

@laughingmaus thank you. That was helpful. I am going to try it out. Do I have to do the css change in every .snippets folder for each vault or can I just do it at the parent vault level and it would propagate to all the vaults within it?

Hello, @fierce_ninja. You could always add this to a snippet:

p {
text-indent: 2em;
}

This will indent the first line of every paragraph. You may have issues when you don’t want something indented, which is why I won’t use it. But it works in preview. The editor is a whole other animal.

1 Like

Hi @fierce_ninja. You are very welcome. You will have to copy and enable it in each of your separate vaults - even if they are children of a parent vault.

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