mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Add 'submodules/AsyncDisplayKit/' from commit '02bedc12816e251ad71777f9d2578329b6d2bef6'
git-subtree-dir: submodules/AsyncDisplayKit git-subtree-mainline:d06f423e0egit-subtree-split:02bedc1281
This commit is contained in:
22
submodules/AsyncDisplayKit/docs/static/linkify.js
vendored
Executable file
22
submodules/AsyncDisplayKit/docs/static/linkify.js
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
[].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);
|
||||
});
|
||||
Reference in New Issue
Block a user