Green
https://lh3.googleusercontent.com/a/ACg8ocLcBURTJMHSvMoF9Jm2olZ1Y6CAkIWW92nSZNuOVwX1AgQ=s96-c#.png ここは Spica GreenのページですScrapbox Beaver.icon
◆ コードブロック内の全角文字バグ対策
code:script.js
(() => { // 即時関数とやらで書くのが良いらしい?
scrapbox.on('lines:changed', twoBytesCharacterColoring);
twoBytesCharacterColoring();
function twoBytesCharacterColoring() {
if (!window.scrapbox.Page.lines) return;
const codeCharList =
document.querySelectorAll('.line span.code-block span.indent span.char-index');
for (const c of codeCharList) {
const char = c.textContent; // 文字を取得
c.style.color = '#888888'; // 文字色はおとなしく
c.style.backgroundColor = '#FFF0E0'; // 背景色を設定 警告的な色
c.style.fontWeight = 'bold'; // フォントの太さを設定
c.style.letterSpacing = '0.16em'; // 編集時カーソル位置不具合対策?
c.style.fontSize = '80%'; // ちょっと小さめに書いて
}
} // ( { ` 0123 . ” - | 誤字対策!
}
})();