Skip to content

If there is a table or block of code,.textSelection(.enabled) only copies some (truncated by the code or table) when copying, can it be optimized? #224

Closed Answered by gonzalezreal
wscqs asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @wscqs,

The textSelection(_:) modifier in SwiftUI selects the text on a specific Text view. Since a Markdown view has multiple Text views, for instance, one per paragraph, code block, or table cell, we cannot change that behavior.

If you want more control over the text that gets copied, you must implement your own copy button. You can use the styling API to access the contents of a specific block (see #215 and #220). There are more details in this discussion: #201.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gonzalezreal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants