Skip to content

Commit

Permalink
Added support to edit page links for github.dev (web editor) URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhibbitts committed Aug 27, 2023
1 parent 4cb49e1 commit 94dd37b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,11 @@
if (currentBasePath.includes("githubusercontent.com") && (existingEditThisPageLink.substr(existingEditThisPageLink.length - fileExt.length) == fileExt)) {
var editThisPageLink = '';
editThisPageLink = decodeURIComponent(currentBasePath);
editThisPageLink = editThisPageLink.replace('raw.githubusercontent.com', 'github.com');
if (existingEditThisPageLink.includes('github.dev')) {
editThisPageLink = editThisPageLink.replace('raw.githubusercontent.com', 'github.dev');
} else {
editThisPageLink = editThisPageLink.replace('raw.githubusercontent.com', 'github.com');
}
editThisPageLink = editThisPageLink.replace(/\/main/, '/blob/main');
editThisPageLink = editThisPageLink.replace(/\/master/, '/blob/master');
//console.log(lastSegment);
Expand Down

0 comments on commit 94dd37b

Please sign in to comment.