PageSourceSearch

https://komekaigi.dev/2025/js/utils.js

js komekaigi.dev collected 2026-09-26 04:37:31 UTC 477 bytes, 23 lines download raw bytes

1/**
2 * KomeKaigi 共通ユーティリティ関数
3 */
4
5/**
6 * HTMLエスケープ処理
7 * @param {string} text - エスケープするテキスト
8 * @returns {string} エスケープされたテキスト
9 */
10function escapeHtml(text) {
11    if (text == null) return '';
12    
13    const map = {
14        '&': '&',
15        '<': '&lt;',
16        '>': '&gt;',
17        '"': '&quot;',
18        "'": '&#039;'
19    };
20    
21    return String(text).replace(/[&<>"']/g, m => map[m]);
22}
23

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.