Skip to content

Add copy action to code blocks#1801

Draft
Sembauke wants to merge 1 commit into
freeCodeCamp:mainfrom
Sembauke:fix/copyable-code-blocks
Draft

Add copy action to code blocks#1801
Sembauke wants to merge 1 commit into
freeCodeCamp:mainfrom
Sembauke:fix/copyable-code-blocks

Conversation

@Sembauke
Copy link
Copy Markdown
Member

@Sembauke Sembauke commented Jun 2, 2026

Summary

  • add a copy control to rendered block code examples
  • reuse the clipboard/snackbar behavior for inline code and block code
  • add a widget test that verifies block code content is copied

Why

Read-only code examples were rendered through an embedded editor without a reliable way to copy the full snippet, especially when content overflowed horizontally.

Impact

Learners can copy code examples directly from lessons and other HTML-rendered content.

Validation

  • dart analyze lib/ui/views/news/html_handler/html_handler.dart test/widget/html_handler_test.dart
  • flutter test test/widget/html_handler_test.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant