Implement new '/Remove empty elements from recent notes' command#694
Implement new '/Remove empty elements from recent notes' command#694
Conversation
…update plugin version to 1.16.0. Adjust error handling in template rendering and improve documentation in README and CHANGELOG.
|
@jgclark This does not work properly for me. I am going to have to recover all my notes from backup. I just ran it and it, and for instance, this note:
ended up with one blank todo on the page
Log for that one example: |
|
The full log: |
Major ouch. Sorry to hear this. So, I assumed the basic function was working for you, and I was just extending it to:
From the screenshot I can see that (in the terms of this function) you have a number of headings without any content -- e.g. lines 3 and 6. So I'd expect those to get removed. And the empty task should be removed, but no others. I will look further at this as first priority. |
|
I've tested on your note content copied into a test regular note and it works OK. |
…ePlan/plugins into feat-tidy-recent-notes-a0bd7
|
@jgclark I am still trying to find the rhyme/reason for the deleted notes I reported above but a couple of observations in the meantime...
And it (correctly) removed everything in the note
In retrospect, I wonder if it should at least keep a line 1 heading/title in this case -- we certainly would in the case of a project note. Maybe we should do the same with Calendar notes. Would love your thoughts on that?
becomes:
|
|
@jgclark One highly problematic thing that I just noticed is that it deletes the content from @templates also (and many are by-design devoid of content under headings). So it definitely needs to ignore @templates in its scan. |






#691 for plugin version to 1.16.0.