Frontend uudelleenrakennettu: Astro-komponentit, Wasm pääsäikeessä, ei Workeria
Vanha frontend siirretty temp/. Uusi rakenne: - StatusBar.astro, Terminal.astro, Editor.astro, Guide.astro - global.css erillinen - Wasm pääsäikeessä (ei Worker — yksinkertainen, debugattava) - Tab-completion, dropdown, projektikortti, Monaco, GUIDE.md - Ei tokenisointia eikä koodilaboratoriota Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
32
network-poc/frontend/node_modules/decode-named-character-reference/index.dom.js
generated
vendored
Normal file
32
network-poc/frontend/node_modules/decode-named-character-reference/index.dom.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/// <reference lib="dom" />
|
||||
|
||||
/* global document */
|
||||
|
||||
const element = document.createElement('i')
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @returns {string | false}
|
||||
*/
|
||||
export function decodeNamedCharacterReference(value) {
|
||||
const characterReference = '&' + value + ';'
|
||||
element.innerHTML = characterReference
|
||||
const character = element.textContent
|
||||
|
||||
// Some named character references do not require the closing semicolon
|
||||
// (`¬`, for instance), which leads to situations where parsing the assumed
|
||||
// named reference of `¬it;` will result in the string `¬it;`.
|
||||
// When we encounter a trailing semicolon after parsing, and the character
|
||||
// reference to decode was not a semicolon (`;`), we can assume that the
|
||||
// matching was not complete.
|
||||
if (
|
||||
character.charCodeAt(character.length - 1) === 59 /* `;` */ &&
|
||||
value !== 'semi'
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
// If the decoded string is equal to the input, the character reference was
|
||||
// not valid.
|
||||
return character === characterReference ? false : character
|
||||
}
|
||||
Reference in New Issue
Block a user