Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
toc_filter
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_filter
Merge requests
!9
Resolve
#3446187
"Add gitlab ci"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Resolve
#3446187
"Add gitlab ci"
issue/toc_filter-3446187:3446187-add-gitlab-ci
into
8.x-2.x
Overview
0
Commits
21
Pipelines
14
Changes
12
Open
Vladimir Roudakov
requested to merge
issue/toc_filter-3446187:3446187-add-gitlab-ci
into
8.x-2.x
1 year ago
Overview
0
Commits
21
Pipelines
14
Changes
12
Expand
0
0
Merge request reports
Compare
8.x-2.x
version 13
c5dde2c3
2 months ago
version 12
53024784
2 months ago
version 11
f567a70d
2 months ago
version 10
feb309b1
2 months ago
version 9
6cf97d36
2 months ago
version 8
c1da2e4c
2 months ago
version 7
671560d9
2 months ago
version 6
56abc9de
2 months ago
version 5
d373772c
2 months ago
version 4
2fa52284
2 months ago
version 3
3f48a335
8 months ago
version 2
bd5e848c
8 months ago
version 1
aa6df5bc
1 year ago
8.x-2.x (HEAD)
and
latest version
latest version
d665e525
21 commits,
2 months ago
version 13
c5dde2c3
22 commits,
2 months ago
version 12
53024784
21 commits,
2 months ago
version 11
f567a70d
19 commits,
2 months ago
version 10
feb309b1
18 commits,
2 months ago
version 9
6cf97d36
17 commits,
2 months ago
version 8
c1da2e4c
15 commits,
2 months ago
version 7
671560d9
12 commits,
2 months ago
version 6
56abc9de
9 commits,
2 months ago
version 5
d373772c
8 commits,
2 months ago
version 4
2fa52284
6 commits,
2 months ago
version 3
3f48a335
4 commits,
8 months ago
version 2
bd5e848c
3 commits,
8 months ago
version 1
aa6df5bc
2 commits,
1 year ago
12 files
+
97
−
50
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
Search (e.g. *.vue) (Ctrl+P)
src/Plugin/Block/TocFilterBlock.php
100755 → 100644
+
6
−
5
Options
@@ -32,19 +32,20 @@ class TocFilterBlock extends TocBlockBase {
// Node should have [toc] token or filter should have auto enabled.
$format_id
=
$node
->
body
->
format
;
if
(
$format_id
!==
NULL
){
$format
=
FilterFormat
::
load
(
$format_id
);
if
(
$format
&&
$format
->
filters
(
'toc_filter'
))
{
if
(
$format_id
!==
NULL
)
{
$format
=
FilterFormat
::
load
(
$format_id
);
if
(
$format
&&
$format
->
filters
(
'toc_filter'
))
{
$toc_filter_config
=
$format
->
filters
(
'toc_filter'
)
->
getConfiguration
();
// If auto is disabled, and there is no [toc token, don't display block.
if
(
!
$toc_filter_config
[
'settings'
][
'auto'
]
&&
stripos
(
$node
->
body
->
value
,
'[toc'
)
===
FALSE
)
{
return
AccessResult
::
forbidden
();
}
}
}
else
{
}
else
{
return
AccessResult
::
forbidden
();
}
// Since entities (ie node) are cached we need to pass the current node's
// body through it's filters and see if a TOC is being generated and
// displayed in this block.
Loading