Remove $ prompts when copying terminal commands - #4490
Closed
JairajJangle wants to merge 1 commit into
Closed
Conversation
Author
|
Closing due to: #4108 (comment) :( |
Author
|
Nvm, closing this for good after checking the long history of failures to tackle this particular QOL issue. + The mdBook(upstream as everyone says) is no longer accepting PRs on new issues as per the contribution guide:
|
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.
QOL improvement for online doc interaction - prevent
$prompt char from being copied with the copy to clipboard button on code blocks.This might not be the most elegant way to tackle this; however, the other solution was to introduce HTML to specifically exclude the
$char from the code block and thus from being selected at all. However, that would break the printability of the book.For reference:

Earlier, if you pressed the copy button, it would copy the entire line like so:
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | shAfter the improvement, the copied text would be:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | shCopying of texts without
$is unaffected.Copying of texts having

$but aren't necessarily shell code is smartly exempted. So, if you copy this:It would remain as is: