I do use @others and occasionally << named sections >> (though rarely).

Also, where does this 'collected' text go? How do I copy into another 
application (which is the whole point).


On Sunday, May 23, 2021 at 5:02:02 PM UTC-4 [email protected] wrote:

> You could collect the body text yourself,  It's not hard. For a selected 
> node, you can find the entire subtree like this:
>
> p = c.p
> tree = [p]
> tree.extend(p.subtree()) # tree includes entire tree starting at selected 
> node
>
> You can collect all the text from these nodes easily as long as you don't 
> need to indent them according to their child level:
>
> collected = ''
> collected = [n.b for n in tree]
> collected_text = '\n'.join(collected)
>
> This won't work if you are using *@others* or *<< named sections>>. * It 
> will also collect all Leo @-directives, so if you use them you would have 
> to filter them out.  But as long as you only need the collected body text, 
> this code should do the job.
> On Sunday, May 23, 2021 at 4:42:54 PM UTC-4 Rob wrote:
>
>> Based on the feedback, it sounds like the result is intentional, so I'll 
>> file it as an enhancement, not a bug. That's what I wanted to know.
>>
>> I also wonder if the script I use might be modified in some way to 'not' 
>> strip blank lines, i.e., copy all 'as is', making no modifications. That 
>> would be the best fix for me in my use case.
>>
>> I got the original script code from Vitalije as I couldn't have done that 
>> on my own.
>>
>> Rob...
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6733a0c7-2cd8-40df-8fd9-bca4a1fac9aen%40googlegroups.com.

Reply via email to