File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
// ==UserScript==
2
2
// @name GitHub Table of Contents
3
- // @version 2.1.5
3
+ // @version 2.1.6
4
4
// @description A userscript that adds a table of contents to readme & wiki pages
5
5
// @license MIT
6
6
// @author Rob Garrison
7
7
// @namespace https://github.com/Mottie
8
- // @include https://github.com/*
9
- // @include https://gist.github.com/*
8
+ // @match https://github.com/*
9
+ // @match https://gist.github.com/*
10
10
// @run -at document-idle
11
11
// @grant GM_registerMenuCommand
12
12
// @grant GM.registerMenuCommand
35
35
right : "10px" , // popup right position when reset
36
36
headerPad : "48px" , // padding added to header when TOC is collapsed
37
37
headerSelector : [ ".header" , ".Header" , ".header-logged-out > div" ] ,
38
+ wrapperSelector : "#wiki-body, #readme, [id^='file-'][id$='-md']" ,
38
39
headerWrap : ".js-header-wrapper" ,
39
40
toggle : "g+t" , // keyboard toggle shortcut
40
41
restore : "g+r" , // keyboard reset popup position shortcut
267
268
if ( ! tocInit ) {
268
269
return ;
269
270
}
270
- const wrapper = $ ( "#wiki-body, #readme" ) ;
271
+ const wrapper = $ ( defaults . wrapperSelector ) ;
271
272
if ( wrapper ) {
272
273
let indx , header , anchor , txt ;
273
274
let content = "<ul>" ;
You can’t perform that action at this time.
0 commit comments