warn-unlinkable-title
ja
code:script.js
let warningIcon
setInterval(() => {
warningIcon?.remove()
const lineTitleText = document.querySelector('.lines .line-title .text')
const text = lineTitleText?.textContent ?? ''
if (text === '') {
return
}
const exps = []
exps.push(text.includes('|| text.includes(''))
// ` を2つ以上含む
exps.push(text.indexOf('') !== text.lastIndexOf(''))
// 数式 | $ で始まる
exps.push(/^$\s/.test(text))
// 外部リンク | / で始まる
exps.push(/^\//.test(text))
// http(s)://を含む
exps.push(/https?:\/\//.test(text))
// 正常終了
if (exps.every((exp) => exp === false)) {
return
}
// 異常は描画
warningIcon = document.createElement('span')
warningIcon.style.position = 'absolute'
warningIcon.style.left = '100%'
warningIcon.style.color = 'red'
warningIcon.textContent = '!'
lineTitleText.prepend(warningIcon)
}, 1000)