-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
25 lines (23 loc) · 797 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// All ems with platform content should be styled as platform label
function fixPlatformLabels () {
var ems = document.querySelectorAll('em')
Array.prototype.forEach.call(ems, function (em) {
if (em.textContent === 'macOS' || em.textContent === 'Linux' || em.textContent === 'Windows') {
em.classList.add('platform-label')
}
})
}
// Override incorrect styling of string templates and colons in objects
function fixSyntaxHighlighting () {
var sts = document.querySelectorAll('.err')
Array.prototype.forEach.call(sts, function (st) {
console.log('wtf')
if (st.textContent === '`' || st.textContent === ':') {
st.classList.remove('err')
}
})
}
document.addEventListener('DOMContentLoaded', function() {
fixPlatformLabels()
fixSyntaxHighlighting()
})