Spit from here.
Even though the the bugs involving callouts have been been fixed in 1.6.4, the information about the task location contained within the cache (Obsidian’s internal data structure) is still wrong.
Spit from here.
Even though the the bugs involving callouts have been been fixed in 1.6.4, the information about the task location contained within the cache (Obsidian’s internal data structure) is still wrong.
I have some additional details, which may save some time for plugin authors, and explain what is going on under the hood in Obsidian to cause this issue.
It also reveals the workaround, which is to remove any labels from callouts that contain tasks, list items, and likely tags or anything else you want to search for.
In the sections below, I show the CachedMetaData for two different example callouts that each contain a task.
This data is generated by Obsidian when it parses Markdown files, and is used by plugins to find interesting markdown content.
From the description in this bug report, it sounds like it is used by Obsidian too to toggle task checkboxes.
Consider this markdown:
> [!NOTE]
> - [ ] Task in 'callout_v1'
Obsidian 1.6.3 generates the following (correct) CachedMetaData for the above markdown file:
{
"cachedMetadata": {
"sections": [
{
"type": "callout",
"position": {
"start": {
"line": 0,
"col": 0,
"offset": 0
},
"end": {
"line": 1,
"col": 28,
"offset": 38
}
}
}
],
"listItems": [
{
"position": {
"start": {
"line": 1,
"col": 2,
"offset": 12
},
"end": {
"line": 1,
"col": 28,
"offset": 38
}
},
"parent": -1,
"task": " "
}
]
}
}
Note the section beginning listItems
- this says that the first lit item/checkbox starts at line 1… It sounds from 0, so to a human it is saying that the first task starts on line number 2, which is correct.
Consider this markdown, which differs only in that Some Title
has been added to the callout line:
> [!NOTE] Some Title
> - [ ] Task in 'callout_v2'
Obsidian 1.6.3 generates the following incorrect CachedMetaData for the above markdown file:
{
"cachedMetadata": {
"sections": [
{
"type": "callout",
"position": {
"start": {
"line": 0,
"col": 0,
"offset": 0
},
"end": {
"line": 1,
"col": 28,
"offset": 49
}
}
}
],
"listItems": [
{
"position": {
"start": {
"line": 2,
"col": 0,
"offset": 50
},
"end": {
"line": 2,
"col": 26,
"offset": -1
}
},
"parent": -2,
"task": " "
}
]
}
}
Note the section beginning listItems
- this says that the first lit item/checkbox starts at line 2… It sounds from 0, so to a human it is saying that the first task starts on line number 3.
Since there is no line in the Markdown starting at 1-based line 3, neither Obsidian nor any plugin can find the task line to interact with.
It’s not just the line numbers in listItems
. Tag positions are wrong too.
Here is a visual diff of the the markdown files:
And here is a visual diff of the CachedMetaData, showing the change in line numbers, even though the line numbers are the same in the markdown files:
The behaviour described above is still present in Obsidian 1.6.4 (Insiders build)
Ah - The fix requires knowing that an edit needs to be made anywhere in the markdown file containing the labelled callout, in order to force Obsidian to re-parse the file and generate correct line numbers.
After a couple of seconds of inactivity, the cached data will be updated.
Don’t Undo the edit, as apparently the cached data would then be reverted.
Just to note that the issue is specific to callouts with labels, so it might be a bit clearer with this title:
“Tasks inside callouts with labels have incorrect positions in the cache”
In version 1.6.5 a new advanced settings will be introduced to force rebuild the metadata cache.
If you are affected by this issue, go to Settings → Files and links → Advanced → Rebuild vault cache.
For more information, there is also an explanation of the metadata cache on the Help site: https://help.obsidian.md/Files+and+folders/How+Obsidian+stores+data#Metadata+cache
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.