diff --git a/static/index.html b/static/index.html index 91af0cf..52f266c 100644 --- a/static/index.html +++ b/static/index.html @@ -280,8 +280,8 @@ Double-click any word to look it up on the right."> - +
@@ -605,7 +605,17 @@ function renderStress(lines){ let html = ''; lines.forEach((line, i)=>{ const fresh = analysis && analysis.lines[i] === line; - const spans = (fresh ? (byLine[i] || []) : []).slice().sort((a,b)=>a.s-b.s); + let raw = []; + if(fresh){ + raw = byLine[i] || []; + }else if(analysis && typeof analysis.lines[i] === 'string'){ + const old = analysis.lines[i]; + let cp = 0; + const n = Math.min(old.length, line.length); + while(cp < n && old[cp] === line[cp]) cp++; + raw = (byLine[i] || []).filter(s=>s.e <= cp); + } + const spans = raw.slice().sort((a,b)=>a.s-b.s); let pos = 0, h2 = ''; spans.forEach(s=>{ if(s.s < pos) return;