Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
db73b650
Unverified
Commit
db73b650
authored
Oct 01, 2021
by
broxen
Committed by
GitHub
Oct 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: issue with Custom Header IDs (#4527)
Fix the issue described in discussion #3502 regarding header links and TOC failing to properly generate when header ID is custom defined.
parent
8aa02318
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
renderer.js
server/modules/rendering/html-core/renderer.js
+3
-2
No files found.
server/modules/rendering/html-core/renderer.js
View file @
db73b650
...
...
@@ -201,10 +201,11 @@ module.exports = {
let
headers
=
[]
$
(
'h1,h2,h3,h4,h5,h6'
).
each
((
i
,
elm
)
=>
{
let
headerSlug
=
uslug
(
$
(
elm
).
text
())
// -> If custom ID is defined, try to use that instead
if
(
$
(
elm
).
attr
(
'id'
))
{
return
headerSlug
=
$
(
elm
).
attr
(
'id'
)
}
let
headerSlug
=
uslug
(
$
(
elm
).
text
())
// -> Cannot start with a number (CSS selector limitation)
if
(
headerSlug
.
match
(
/^
\d
/
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment