Copy only visible items from preview mode or have consistent behaviour in read mode

Hey there,

I have notes with lots of tasks/Bullet points like this:

  • [ ] copy tmp file a to permanent location b

       cp a /b/
    
  • [ ] remove old file when done
    rm a
    I want to hide the code bloc (e.g. by folding), leaving only the the topics visible. so that it becomes:

  • [ ] copy tmp file a to permanent location b

  • [ ] remove old file when done
    Then I want to extract that information to other notes within Obsidian or to other applications like emails or a word file leaving behind the folded hidden stuff.

Copying only visible parts works in read mode but I can’t hide code blocks below Bullet Points.
On the other hand folding code blocs beneath bullet points/Tasks works in preview but copying retrieves the whole content of the selection not only the visible text.

I found an oldish thread How do I copy only visible items?
that states that this should actually work in preview. was this changed on purpose or is it a bug?

Kind regards
zoltan

Have you tried foldable callouts?

Thanks for reply, I’ve read that this might help to fold but at the cost of adding unnecessary elements that I need to remove after export. I’d like to keep it as minimalistic as possible.

I Worked around this by actually using Callouts as per @blue_emperor’s proposition proposal and prepended an icon :receipt: to have something I can refer to.

Callouts have another drawback: they don’t seam to be widely understood in Markdown dialects.
I’d really like to know how “copy in Read mode” weaves it magic to keep formatting across different applications being targets for pasting the content thereafter.
Does anyone know how this works?

Kind regards
zolt