Repository navigation
Allow selecting and copying text in preview and source markdown views - #460
Merged
amirlehmam merged 1 commit intoNov 15, 2026
Merged
Conversation
The app disables text selection on <html>, and Chromium passes that down, so nothing in a Markdown pane could be selected. The preview and source views now opt back in. The code-block Copy button is excluded so its label is not copied with the code, and a blank source line renders a <br> instead of a space, so a copied selection keeps blank lines without trailing spaces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Text in a Markdown pane cannot be selected, in either preview or source mode, so nothing shown there can be copied except through the toolbar's whole-document Copy button.
Change
.markdown-pane__content(preview) and.markdown-pane__source(source view, including the single<pre>used for very large files) setuser-select: text.user-select: none, so its label is not copied along with the code.<br>instead of a space. A space was copied as a trailing space on every blank line, and an empty span drops the line from the copied text altogether.Copying uses Electron's default Edit menu (Ctrl+C) and wmux's existing Ctrl+Shift+C shortcut; neither needed changes.
Testing
npm test: 414 files passed, 2 skipped; 6701 tests passed, 10 skipped. No existing test covers the Markdown pane, and jsdom cannot exercise selection, so no test was added.npm run typecheckandeslintonMarkdownPane.tsxare clean.Known limitations
::marker), not text, and Chromium leaves them out of plain-text copies. Restoring them would take a custom copy handler.