Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
toc_js
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
toc_js
Merge requests
!16
Issue
#3468365
: Possibility of inheriting classes from main page heading tags?
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3468365
: Possibility of inheriting classes from main page heading tags?
issue/toc_js-3468365:3468365-inherit-css-classes-from-headings
into
3.0.x
Overview
0
Commits
1
Pipelines
4
Changes
6
Merged
Frank Mably
requested to merge
issue/toc_js-3468365:3468365-inherit-css-classes-from-headings
into
3.0.x
10 months ago
Overview
0
Commits
1
Pipelines
4
Changes
6
Expand
Closes
#3468365
0
0
Merge request reports
Compare
3.0.x
version 3
5e83c056
10 months ago
version 2
77787178
10 months ago
version 1
fff7087e
10 months ago
3.0.x (base)
and
latest version
latest version
957911ce
1 commit,
10 months ago
version 3
5e83c056
1 commit,
10 months ago
version 2
77787178
1 commit,
10 months ago
version 1
fff7087e
1 commit,
10 months ago
6 files
+
37
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
assets/js/tocjs.js
+
7
−
0
Options
@@ -214,6 +214,13 @@
const
li
=
document
.
createElement
(
'
li
'
);
li
.
classList
.
add
(
opts
.
itemClass
(
heading
,
opts
.
prefix
));
$
(
li
).
addClass
(
opts
.
liClasses
);
if
(
opts
.
inheritableClasses
.
length
>
0
)
{
heading
.
classList
.
forEach
((
className
)
=>
{
if
(
opts
.
inheritableClasses
.
includes
(
className
))
{
li
.
classList
.
add
(
className
);
}
});
}
li
.
append
(
a
);
const
level
=
heading
.
tagName
.
slice
(
-
1
);
Loading