File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -87,25 +87,22 @@ export default function () {
87
87
88
88
if ( parentSection ) {
89
89
const ids = [ ] ;
90
- let id ;
91
90
92
91
const heading = parentSection . heading ;
93
92
if ( heading . id ) {
94
- id = heading . id ;
93
+ ids . push ( heading . id ) ;
95
94
href = getAbsoluteUrl ( heading , { singlePage } ) ;
96
- ids . push ( id ) ;
97
95
}
98
96
else {
99
97
const anchor = heading . querySelector ( 'a[name]' ) ;
100
98
if ( anchor ) {
101
- id = anchor . getAttribute ( 'name' ) ;
99
+ ids . push ( anchor . getAttribute ( 'name' ) ) ;
102
100
href = getAbsoluteUrl ( anchor , { singlePage, attribute : 'name' } ) ;
103
- ids . push ( id ) ;
104
101
}
105
102
}
106
103
107
104
if ( parentSection . root && parentSection . root . id ) {
108
- id = parentSection . root . id ;
105
+ ids . push ( parentSection . root . id ) ;
109
106
href = getAbsoluteUrl ( parentSection . root , { singlePage } ) ;
110
107
}
111
108
@@ -114,10 +111,6 @@ export default function () {
114
111
const number = match ? match [ 1 ] : null ;
115
112
116
113
const mapping = { } ;
117
- if ( id ) {
118
- ids . push ( id ) ;
119
-
120
- }
121
114
if ( ids . length ) {
122
115
mapping . id = ids . pop ( ) ;
123
116
}
You can’t perform that action at this time.
0 commit comments