fix(labs): SVG markup rendered as text in 6 simulations
Hardcoded inline <svg class="ic"> markers used as arrow replacements (left over from emoji removal) were displayed as raw HTML text where the consumer used textContent or canvas fillText: - chemsandbox: csbar-v5 (Продукты cell) used textContent → SVG visible. Switched to innerHTML for consistency with eq/ionNet cells. Quiz question (qEl.textContent) and answer also receiving SVG — cleaned via _csClean at source. - reactions: modeTxt drawn via canvas fillText — replaced SVG with →. - ionexchange: REACTIONS data + canvas labels — bulk SVG → Unicode arrows. - newton: action button labels used textContent → switched to innerHTML; canvas arrow labels: SVG → Unicode →/↓. - collision: 'KE сохранена' canvas label — SVG checkmark → ✓. - projectile: canvas badges + textContent wind label — SVG → Unicode ←/→/↩. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1585,7 +1585,7 @@ class ChemSandboxSim {
|
||||
if (rx.fx.gas) {
|
||||
questions.push(`Получи газ ${rx.fx.gas}`);
|
||||
}
|
||||
questions.push(`Проведи реакцию: ${prods}`);
|
||||
questions.push(`Проведи реакцию: ${_csClean(prods)}`);
|
||||
if (rx.type === 'Нейтрализация') {
|
||||
questions.push('Проведи реакцию нейтрализации');
|
||||
}
|
||||
@@ -1622,7 +1622,7 @@ class ChemSandboxSim {
|
||||
score: this._quizScore,
|
||||
total: this._quizTotal,
|
||||
result: this._quizResult,
|
||||
answer: this._quizTask ? this._quizTask.rx.eq : null,
|
||||
answer: this._quizTask ? _csClean(this._quizTask.rx.eq) : null,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1821,7 +1821,9 @@ class ChemSandboxSim {
|
||||
const eqEl = document.getElementById('csbar-v4');
|
||||
eqEl.innerHTML = info.equation || '—';
|
||||
eqEl.title = (info.equation || '').replace(/<[^>]*>/g, '');
|
||||
document.getElementById('csbar-v5').textContent = info.products || '—';
|
||||
const prodEl = document.getElementById('csbar-v5');
|
||||
prodEl.innerHTML = info.products || '—';
|
||||
prodEl.title = (info.products || '').replace(/<[^>]*>/g, '');
|
||||
const ionEl = document.getElementById('csbar-v6');
|
||||
ionEl.innerHTML = info.ionNet || '—';
|
||||
ionEl.title = (info.ionNet || '').replace(/<[^>]*>/g, '');
|
||||
|
||||
Reference in New Issue
Block a user