Closed Number-3434 closed 3 months ago
Adding a way to copy the code is something that would need to be done in the IDE extension (https://github.com/Dart-Code/Dart-Code/issues/4939). There's nothing specific to do here in the markdown package besides the existing request for offsets/lengths in parsed results (https://github.com/dart-lang/markdown/issues/369).
(I think we should close this as a dupe of those issues)
This exists on pub.dev, I don't see how it's related to markdown parsing.
If you're suggesting it be done in generated documentation, that's an issue for dartdoc.
We did on pub.dev using javascript to find the code tags that should have a copy button added.
The request here was about allowing it in the IDE (eg. code blocks inside doc comments can easily be copied). To do this, we need to reliably know the offset/lengths of the code blocks within the doc comments (while we could approximate this with regex, it should really be done with real parsing).
Please add a button to
copy code
in code spans in markdown documentation comments.Like the following:
Also open here.