Refined-github: Missing copy button in Markdown files

Created on 27 Mar 2018  路  10Comments  路  Source: sindresorhus/refined-github

Issuehunt badges

Hey everyone,

I love this extension but I realized that the "Copy" button that is inserted for some file types isn't inserted in Markdown files? Is this by design? I store a bunch of Markdown files on GitHub that I regularly copy and it would be great to have the button there as well :)

If this isn't by design I'm happy to research and fix this issue.

Cheers,
Dominik

janat08 earned $60.00 by resolving this issue!

Rewarded on Issuehunt enhancement help wanted

All 10 comments

That's because the code responsible for this feature takes the code to be copied directly from the page (or, to be more clear, instructs ZeroClipboard to do that). For Markdown files, GitHub shows a preview instead of the code which makes this impossible.

We're currently discussing implementing the option to show a Markdown file's code in #946. Once that feature is implemented using the suggested "Blame trick" the only thing left to do would be to make the Copy button work with blame views.

That was my guess. Thanks a lot!

@issuehunt has funded $60.00 to this issue.


I guess this should be part of the aforementioned feature (#946) because it depends on it

You mean it's already implemented, can i take it for bounty?

It means you'd have to ensure that copy-file happens after view-markdown-source so the first adds a button to the second (or something along those lines)

Went for simple solution halfway through, the solution where the stuff to be copied is preloaded instead of requiring action from user is still in pull request. This could also benefit view-markdown module.

There're two bugs and regression.
I imagine the regression and bug is fixed in current code pertaining to what is copied (text), and the bug pertaining preloading code triggering twice is is still there. Also as per review the global variables aren't scoped.

Btw it just occured to me that there's now implicit dependency on view-markdown.

For comments related to your code, leave them in the PR

@sindresorhus has rewarded $54.00 to @janat08. See it on IssueHunt

  • :moneybag: Total deposit: $60.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $6.00
Was this page helpful?
0 / 5 - 0 ratings

Related issues

MilesBHuff picture MilesBHuff  路  3Comments

mareksuscak picture mareksuscak  路  3Comments

supremebeing7 picture supremebeing7  路  3Comments

hkdobrev picture hkdobrev  路  3Comments

shivapoudel picture shivapoudel  路  3Comments