Skip to content

Add optional copy buttons for fenced code blocks#291

Open
geauxtigers wants to merge 1 commit intosimov:mainfrom
geauxtigers:feature/copy-buttons
Open

Add optional copy buttons for fenced code blocks#291
geauxtigers wants to merge 1 commit intosimov:mainfrom
geauxtigers:feature/copy-buttons

Conversation

@geauxtigers
Copy link
Copy Markdown

Summary

This PR adds an optional copy content setting that shows copy buttons on fenced code blocks.

Changes

  • adds content.copy default and migration handling
  • adds a popup label for the new setting
  • renders copy buttons for syntax-highlighted fenced code blocks
  • copies the live code block text to the clipboard
  • trims trailing CR/LF from copied content so the clipboard ends at the last printable character
  • toggles a visual marked state on successful copy
  • documents the new option in the README

Behavior

  • the feature is off by default
  • buttons are shown only when copy is enabled
  • successful copy toggles the button between its base state and a green marked state
  • the copied text preserves indentation and internal blank lines, but drops trailing line endings

Scope

This PR intentionally does not include the unrelated background-script guard fixes, which are proposed separately.

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