mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00

git-subtree-dir: submodules/AsyncDisplayKit git-subtree-mainline: d06f423e0ed3df1fed9bd10d79ee312a9179b632 git-subtree-split: 02bedc12816e251ad71777f9d2578329b6d2bef6
23 lines
536 B
JavaScript
Executable File
23 lines
536 B
JavaScript
Executable File
[].slice.apply(
|
|
document.querySelectorAll(
|
|
'article h2, article h3, article h4'
|
|
)
|
|
).forEach(function(header) {
|
|
var slug = header.innerText
|
|
.toLowerCase()
|
|
.replace(/[^a-z0-9]/g, '-')
|
|
.replace(/-+/g, '-')
|
|
.replace(/^-|-$/g, '');
|
|
|
|
var hashref = document.createElement('a');
|
|
hashref.id = slug;
|
|
hashref.className = 'hashref';
|
|
header.appendChild(hashref);
|
|
|
|
var hash = document.createElement('a');
|
|
hash.className = 'hash';
|
|
hash.href = '#' + slug;
|
|
hash.innerText = '#';
|
|
header.appendChild(hash);
|
|
});
|