TA_sectionGetContentByHeading doesn't return all three-state tasks

When using the editor.TA_sectionGetContentByHeading method to return the tasks under each heading, the method only seems to be returning - {x} lines and not - {-} or - { } lines.

Anyone else getting the same?

Thanks!

Hi @sylumer - could you help with the above if you get a chance?

Thanks!

Example draft content for a Draft using multi-state checkboxes and Simple List syntax.

# Section 1
Some content
Here

# Section 2
Some tasks
-  {x} First
-  {-} Second
- { } Third

# Section 3
More content
Here

Note the Markdown section headings are recognised as navigation markers.

Example code.

alert(editor.TA_sectionGetContentByHeading("# Section 2"));

Result of running the code against the example content are as follows.

That suggests to me it is working and returning those lines. But, if you have details of an example that does not work, then that can be investigated.

I don’t remember all the code for this, but I’m pretty sure it just splits the Draft into sections using the navigation markers and returns the content within that section. There should not be eny processing of the section, so I would not expect the content within a section to be modified upon return by this function. But, if it is, a worked example like the one I provided here should allow me to reproduce and debug any such issue.

1 Like

Got it working, it was an issue on my end! Thanks @sylumer for the reply (and for the amazing ThoughtAsylum Drafts Library!)