obsidian-tasks
obsidian-tasks copied to clipboard
option to disable processing of Reading View (Tasks assumes single-line task items which affects much rendering)
Edit on 2022-11-16 Updated for clarity and for more comprehensive feature request (re-including content of post https://github.com/obsidian-tasks-group/obsidian-tasks/issues/1259#issuecomment-1315636716 later in this thread)
Ok I redid the sample code and the screenshots. Hopefully this is clearer, and also you can see this is not just about embeds, it's also about fenced code blocks, blockquotes, and callouts (which are rendered above!). I don't think this is an edge case. It would be great if there was an option to simply not touch the Reading View, which I never use to toggle checkboxes.
The Markdown source
## A block just for embedding
Nothing to see here 😃
## The Tasks bug in Reading View
- [ ] first item with embed: ✅ ![[Obsidian playground#A block just for embedding]]
- [ ] Second item with embed: ❌ ![[Obsidian playground#A block just for embedding]]
- [ ] Third item with a code block ❌
```
code block
```
- [ ] Fourth item with a blockquote ❌
> block quote
- [ ] Fifth item with a callout ❌
> [!NOTE] this is a note
- [ ] Sixth item with a subtask ✅
- [ ] Subtask
- [ ] Seventh item with an item ✅
- Subitem
What Reading View looks like without Obsidian Tasks

What Reading View looks like with Obsidian Tasks

Issue information
Feature Request
An option to disable any processing of the Reading View, so as to circumvent any possible issues here.
Obsidian Version
1.0.3
Tasks Plugin Version
1.18.1
Original post from 2022-10-26
Expected Behavior
- In file called
Obsidian Playground, create:
- [ ] first item
- [ ] ![[Obsidian playground#^635d8c]]
New paragraph
- [ ] ![[Obsidian playground#^635d8c]]
New paragraph
^635d8c
- Compare Live Preview and Reading view. I expect them to be the same and look like Live Preview:

Current behaviour
Reading View is rendered as:

Steps to reproduce
See "Expected Behavior" above.
Which Operating Systems are you using?
- [ ] Android
- [ ] iPhone/iPad
- [ ] Linux
- [X] macOS
- [ ] Windows
Obsidian Version
1.0.2
Tasks Plugin Version
1.15.1
Checks
- [X] I have tried it with all other plugins disabled and the error still occurs
Possible solution
No response
Thank you for reporting this behaviour.
Tasks expects each Task to be a single line, and to be rendered as a single line.
I am struggling to understand the pictures and what they are actually saying - some annotation on them to point out the bits to be looked at would make them easier to understand.
However, I think this is rather a corner case of rendering, and unfortunately it is unlikely to be treated as a priority.
I'll address each of these lines. But quick question: why does Obsidian Tasks even interfere with the Reading View rendering? I can understand why Tasks handles the rendering of Tasks queries, but why the Reading View when there are no queries there.
But quick question: why does Obsidian Tasks even interfere with the Reading View rendering? I can understand why Tasks handles the rendering of Tasks queries, but why the Reading View when there are no queries there.
Hmm. That is a good question.
@schemar Can you remember why in Reading mode Tasks changes the rendering of tasks (and lists in general)?
It injects the logic to handle task completion. In theory, it could be only necessary to add the handler to the checkbox. However, I remember trying to refactor that once and it turned out to be more complicated. I don't remember the details, sorry.
Oh I see. I wonder if there's an easy way to disable the handler in the reading view, as I never touch checkboxes there (I always do it in the editor in my left pane). Even if I have to fork the repo and make that change.
Ok I redid the sample code and the screenshots. Hopefully this is clearer, and also you can see this is not just about embeds, it's also about fenced code blocks, blockquotes, and callouts (which are rendered above!). I don't think this is an edge case. It would be great if there was an option to simply not touch the Reading View, which I never use to toggle checkboxes.
The Markdown source
## A block just for embedding
Nothing to see here 😃
## The Tasks bug in Reading View
- [ ] first item with embed: ✅ ![[Obsidian playground#A block just for embedding]]
- [ ] Second item with embed: ❌ ![[Obsidian playground#A block just for embedding]]
- [ ] Third item with a code block ❌
```
code block
```
- [ ] Fourth item with a blockquote ❌
> block quote
- [ ] Fifth item with a callout ❌
> [!NOTE] this is a note
- [ ] Sixth item with a subtask ✅
- [ ] Subtask
- [ ] Seventh item with an item ✅
- Subitem
What Reading View looks like without Obsidian Tasks

What Reading View looks like with Obsidian Tasks

Thank you for the example, it is a lot easier to understand the point now. The checkmarks and crosses really help.
The first and second ones are interesting in that when they are reversed the one called second works, and the one called first does not. So the problem is not the content of the line, but the order in which it appears.
It would be great if there was an option to simply not touch the Reading View, which I never use to toggle checkboxes.
That's an interesting suggestion - I would need to think about the consequences of it, but it seems to have diverged quite a lot from the initial summary of the ticket.
It would be really helpful if the summary could be edited to reflect the new request please.
Thank you for updating the title. That's very clear.
It injects the logic to handle task completion. In theory, it could be only necessary to add the handler to the checkbox. However, I remember trying to refactor that once and it turned out to be more complicated. I don't remember the details, sorry.
I saw an idea in Discord that has a small chance of helping with this, so I've started a Developer Discussion to track possibly useful info....
- https://github.com/obsidian-tasks-group/obsidian-tasks/discussions/2323
Stumbled upon something that looks like the same issue. Even image embedding into a task is broken in reading mode (on the left - editing, on the right - reading)
Tasks enabled
Tasks disabled
Stumbled upon something that looks like the same issue. Even image embedding into a task is broken in reading mode (on the left - editing, on the right - reading)
@kykc That is being tracked in https://github.com/obsidian-tasks-group/obsidian-tasks/issues/2554