濁点半濁点が分離している時に警告するUserScript
code:script.js
(() => {
const VOICED_SOUND_MARK = '\u3099'; // 濁点
const SEMIVOICED_SOUND_MARK = '\u309A'; // 半濁点
const colorStyle = 'color: red; background-color: white;';
scrapbox.on('lines:changed', showNFDCharacter);
showNFDCharacter();
function showNFDCharacter() {
if (!window.scrapbox.Page.lines) return;
const codeCharList =
document.querySelectorAll('.lines .char-index');
for (const c of codeCharList) {
const text = c.textContent;
if(text.includes(VOICED_SOUND_MARK) || text.includes(SEMIVOICED_SOUND_MARK)) {
c.style = colorStyle;
}
}
}
})();
記法を展開したら消えちゃう
更新履歴
作成(2022/01/06)