-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Enhance view-markdown-source
with line actions
#3594
Conversation
Co-Authored-By: Fregante <opensource@bfred.it>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that, LGTM, merge at will.
Co-authored-by: Federico <me@fregante.com>
Co-authored-by: Federico <me@fregante.com>
I will make a lint pr to sort them all
@fregante great job! (It's all your code 😀) |
Co-authored-by: Fregante <opensource@bfred.it>
I'd like to blame my code because this is a bad idea. Don't we already have access to this code via the page we're loading? Currently all unrelated code is being stripped by the second parameter of const dom = await fetchDom(path, '.blob-wrapper'); but I think that we can avoid having to maintain these 70 lines by using something like: const page = await fetchDom(path);
lineActions /*global*/ = select('blah blah', page);
const source = select('.blob-wrapper', page); I don't think we even need to customize anything in |
I can give it a shot. This should be part of November lint 🙄 |
Did some debugging. We dont, it looks like its loaded loader on |
Indeed. We fetch the blame page but only the regular source page is supposed to have it, like https://github.com/sindresorhus/refined-github/blob/master/.editorconfig#L3 I've noticed this problem because this feature is currently the longest file and to be fair it's a nightmare just looking at it imagining what class will be dropped next by GitHub. I wonder if we could just fetch it from a random file: const lineActions = onetime(() => {
const bar = fetchDom('https://github.com/sindresorhus/refined-github/blob/b1229bbaeb8cf071f0711bc2ed1b40dd96cd7a05/.editorconfig', 'BlobToolbar');
select('#js-view-git-blame', bar)!.href = new GitHubURL(location.href).assign({route: 'blame'}).href;
select('#js-new-issue', bar)!.href = `/${getRepoURL()}/issues/new`;
return bar;
}); We'd need a |
LINKED ISSUES:
Closes Enhance
view-markdown-source
with line actions #2542TEST URLS:
https://github.com/sindresorhus/refined-github/blob/3d517d6cd00e83a51973808c7ff03cae2b692d2b/contributing.md#L7
SCREENSHOT:
