Claude commited on
Commit
ff48153
·
1 Parent(s): f697ee6

Drop empty OCR and narration blocks from downloaded final HTML

Browse files

When an instructor frame has no on-screen text or the user clears the
narration, the editor's "Download final HTML" output now removes the
corresponding section so the final document doesn't show empty
"On-screen text from video" or narration containers.

The review page itself still renders the editor blocks unconditionally
so users can fill them in if they want.

https://claude.ai/code/session_01G3XpEehfr9DnX9L7BahQ4L

Files changed (1) hide show
  1. app/templates/review.html +12 -0
app/templates/review.html CHANGED
@@ -375,6 +375,18 @@
375
  img.removeAttribute('data-alt-draft');
376
  });
377
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  // Rebuild TOC from remaining segments.
379
  const toc = clone.querySelector('nav.toc');
380
  const remaining = Array.from(clone.querySelectorAll('section.section'));
 
375
  img.removeAttribute('data-alt-draft');
376
  });
377
 
378
+ // Drop empty on-screen text blocks (no OCR captured / user cleared it).
379
+ clone.querySelectorAll('details.onscreen-text').forEach(d => {
380
+ const body = d.querySelector('.onscreen-text__body');
381
+ if (!body || !body.textContent.trim()) d.remove();
382
+ });
383
+
384
+ // Drop empty narration blocks too.
385
+ clone.querySelectorAll('.narration').forEach(n => {
386
+ const body = n.querySelector('.narration__body');
387
+ if (!body || !body.textContent.trim()) n.remove();
388
+ });
389
+
390
  // Rebuild TOC from remaining segments.
391
  const toc = clone.querySelector('nav.toc');
392
  const remaining = Array.from(clone.querySelectorAll('section.section'));