Skip to content

Strip $ from copied shell commands. #20816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2016
Merged

Strip $ from copied shell commands. #20816

merged 1 commit into from
Oct 10, 2016

Conversation

bardiharborow
Copy link
Member

Fixes #20800.

@mdo
Copy link
Member

mdo commented Oct 4, 2016

What if we instead used CSS to render the $ at the beginning of the line with ::before?

@patrickhlauke
Copy link
Member

Alternatively, use user-select:none on the <span> around the $ ?

@patrickhlauke
Copy link
Member

i.e. add this to _syntax.scss (assuming that class isn't used for other stuff)

.gp {
    color: #009;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

@bardiharborow
Copy link
Member Author

@patrickhlauke, this is about the copy button, rather than manually selecting the text, however that suggestion will work if we go the ::before path.

mdo, that would be a better solution, I was just taking the easy way out. I suspect I'll end up adding a shell flag of some kind to highlight that looks something like .highlight-shell::before { content: '$', user-select: none; }. I'll probably get around to this tomorrow.

@mdo
Copy link
Member

mdo commented Oct 4, 2016

I suspect I'll end up adding a shell flag of some kind

I think there's a class in there for the language that you can already utilize?

@bardiharborow
Copy link
Member Author

@mdo, oh, yeah, duh. I've pushed a commit. However this causes problems on multi-line blocks like the NuGet section, because I can't ::before each line. Not sure where to go from here.

@bardiharborow
Copy link
Member Author

@mdo, I've just split the NuGet section into two parts. It's probably not the ideal solution though.

@mdo mdo added this to the v4.0.0-alpha.5 milestone Oct 10, 2016
@mdo mdo merged commit 647db6f into twbs:v4-dev Oct 10, 2016
@bardiharborow bardiharborow deleted the docs-clipboard branch October 10, 2016 04:05
@mdo mdo mentioned this pull request Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants