obsidian-tasks: Multi-line tasks (indented lines below a task items) are not shown in Reading mode and Tasks query results
Please check that this issue hasn’t been reported before.
- I searched previous Bug Reports didn’t find any similar reports.
Expected Behavior
I have two items, one of them a task item with some lines below it (used Shift-Enter to insert these lines). This results in markdown:
- [ ] first line
        second line
        and so one
- not the same behavior for a normal item
    with some more lines
    and another line
The lines below the task item are not shown in read-mode. Rendering as
in edit mode it looks like
This happens only, when the task plugin is enabled.
See also: https://forum.obsidian.md/t/lines-below-task-item-not-visible/61807
Current behaviour
Lines are hidden.
Steps to reproduce
- Setup empty vault
- Paste markdown snippet from above
- Look (edit: in Reading mode)
- Install and enable task plugin
- Restart
- Look again (edit: in Reading mode)
Which Operating Systems are you using?
- Android
- iPhone/iPad
- Linux
- macOS
- Windows
Obsidian Version
1.3.5
Tasks Plugin Version
4.0.0
Checks
- I have tried it with all other plugins disabled and the error still occurs
Possible solution
No response
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 2
- Comments: 15
For those who want to still a workaround of having a very descriptive task that needs to span multiple lines, an alternative is to basically hyperlink your task.
Sorry for not responding earlier, Clare! I missed the notification and failed to add a “come back to this” to my tasks tracker. 😅 Work also picked up a bit, so I haven’t had as much “learning time” as before.
That’s definitely a larger chunk of work than I would have hoped for, but I completely agree with the philosophy. I’m out of time for looking at things today, but I will try to make time tomorrow for digging into that some.
One of the benefits of multiple PRs could also be more distributed work, with regards to both time and persons. Hopefully others will be able to build on things as well.
When I say that this is a large body of work, here is the kind of thing that I mean…
tl;dr This isn’t a single-PR change, it’s a series of incremental changes, each of which needs to be safe, and the code on
mainneeds to be releasable throughout the entire process.If anyone is interested in committing to work on this, I would be available to answer questions, and would add links below to the relevant code locations.
Caveat: this is what I came up with, in about an hour of thinking about it. There may be other things I missed.
Requirements to make this change
My personal philosophy is to always review PRs carefully, to be as confident as I can be that changes (by me and others) do not accidentally cause breakages for users.
This means I only accept PRs to Tasks that contain individual changes, and where any refactorings have been made in small, incremental changes.
I need to either:
Exceptions to this are:
Unfortunately any code in Plugins that imports types from Obsidian like Plugin, MetadataCache, Vault… were not written to be unit-tested… so do not have Jest tests in most plugins.
An exception to this is the Projectswhich may give ideas. (Its licence is Apache - I don’t know if that is compatible with Tasks’ MIT licence.)
How to make this change
I see this change a series of PRs, each of which addresses an incremental part of the project.
For example, there could be some initial PRs to:
etc
How to change the Markdown reading and writing code
It would need to make sure that multiline tasks are both:
Storing tasks
Task.ts
Searching tasks
task.originalMarkdownis a documented facility in - Task Properties - so somehow this would need to be maintained, in order to not break user searchesRendering of tasks
Places to consider:
Users interacting with tasks
Testing
User Documentation
As a case of “two birds with one stone”, would it be possible to consider the following lines of multi-line tasks as part of the description? Then it would be displayed and useable in filters. (I’m willing to contribute to this, if that seems like a reasonable approach.)
@floli I’ve just noticed you’ve pasted the same image link in twice, and it’s not obvious because the image is not shown.
Please kindly edit the report above and paste in the actual images, rather than links to them…
Many thanks.