I can confirm this on the 1.3.5 AppImage for Linux (Ubuntu 22.04).
Obisidan wrongly identifies certain specific lines within code blocks (i.e., blocks bounded within pairs of three backticks) whose first non-whitespace character is a hash sign #
as “fold points” (not sure what the proper term is). I’ll call these “bad fold lines.”
When I open a page, the headers will randomly decide whether to be collapsed/expanded (which is another problem that it would be great if it could be fixed). On the “collapsed” headers, the section below is folded only to the first bad fold line; the remainder of the section is visible.
If I expand the header, the section expands and appears normally. If I then re-collapse the header, the section then collapses only to the next bad fold line. If I expand and re-collapse again, the section collapses to the subsequent bad fold line, etc. That is, the process of expanding and re-collapsing the section header causes the current bad fold line to no longer be mistaken for a fold line.
I cannot reproduce the error at will because it seems to happen only when I load a page that I haven’t loaded recently. I assume that Obsidian has some sort of caching process when it loads pages from their source files, and I’m guessing that the bug in question occurs only when the file is first loaded and processed. Thus, there’s little I can do to set up a minimum repeatable example or capture a video because once the page I’m experimenting with has been worked with, the problem disappears.
Nevertheless, since I copy many code blocks into my Obsidian notes, I’ve noticed the following patterns:
-
If the #
is preceded by whitespace, the line is recognized as a bad fold line if that whitespace is four spaces, but not if that whitespace is a tab.
-
A line otherwise fitting the above condition will not be recognized as a bad fold line if the line above it begins with #
preceded by any number of spaces (including zero). That is, only the first bad fold line in a consecutive series of potential bad fold lines is recongnized.
The one concrete example I can provide is the output of Ubuntu’s apt upgrade
command, which I routinely copy into Obsidian in the form of a code block. In these cases, the raw text
# Header
```bash
me@me:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
#
# News about significant security updates, features and services will
# appear here to raise awareness and perhaps tease /r/Linux ;)
# Use 'pro config set apt_news=false' to hide this and future APT news.
#
The following NEW packages will be installed:
...
will, when I revisit the page later, often be displayed as
> Header ...
#
# News about significant security updates, features and services will
# appear here to raise awareness and perhaps tease /r/Linux ;)
# Use 'pro config set apt_news=false' to hide this and future APT news.
#
The following NEW packages will be installed:
That is, the section is “collapsed” only to the first line beginning with #
.
This error makes it difficult for me to use Obsidian. My notes tend to contain many code blocks with comment lines beginning with #
. Under the current version, every time I load a new page, it presents as an organizational jumble that’s difficult to parse visually until I go through and manually expand/re-collapse each section to clear away the bad fold lines. That interrupts my workflow and my thoughts about what I was about to take notes on.