Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
dba73cf2
Commit
dba73cf2
authored
Apr 13, 2017
by
Marcel Stör
Browse files
Fix HTML anchors in ToC generator
parent
b1dcb705
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/js/extra.js
View file @
dba73cf2
...
...
@@ -38,7 +38,8 @@ var nodemcu = nodemcu || {};
}
function
createTocTableRow
(
func
,
intro
)
{
// fragile attempt to auto-create the in-page anchor
var
href
=
func
.
replace
(
/
\.
|:/g
,
''
).
replace
(
'
()
'
,
''
).
replace
(
'
--
'
,
'
-
'
).
replace
(
/ /g
,
'
-
'
);
// good tests: file.md,
var
href
=
func
.
replace
(
/
[\.
:
\(\)]
/g
,
''
).
replace
(
/ --|, | /g
,
'
-
'
);
var
link
=
'
<a href="#
'
+
href
.
toLowerCase
()
+
'
">
'
+
func
+
'
</a>
'
;
return
'
<tr><td>
'
+
link
+
'
</td><td>
'
+
intro
+
'
</td></tr>
'
;
}
...
...
@@ -220,4 +221,4 @@ var nodemcu = nodemcu || {};
}
return
values
;
}
}());
\ No newline at end of file
}());
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