Skip to content

feat: resolve Ghostwriter richtext-evidence divs to inline images#4

Open
TheGr3atJosh wants to merge 2 commits into
ValienteTechnologies:mainfrom
TheGr3atJosh:feat/resolve-richtext-evidence
Open

feat: resolve Ghostwriter richtext-evidence divs to inline images#4
TheGr3atJosh wants to merge 2 commits into
ValienteTechnologies:mainfrom
TheGr3atJosh:feat/resolve-richtext-evidence

Conversation

@TheGr3atJosh
Copy link
Copy Markdown
Contributor

@TheGr3atJosh TheGr3atJosh commented May 9, 2026

Summary

  • Ghostwriter's TinyMCE stores inline evidence as <div class="richtext-evidence" data-evidence-id="N"></div> (numeric ID), not the older {{.friendly_name}} tag syntax — causing inline evidence to silently disappear from rendered PDFs
  • _build_evidence_index now returns two indexes in a single JSON walk: by friendly_name (for legacy {{.name}} tags) and by numeric id (for richtext-evidence divs)
  • New _resolve_richtext_evidence replaces richtext-evidence divs with <figure><img><figcaption> using the id-based index; the existing {{.name}} resolver is kept for backwards compatibility
  • Both resolvers run sequentially per finding text field in make_vue_data

Test plan

  • Render a report with findings that have inline evidence attached via TinyMCE — evidence images should appear in the PDF with captions
  • Render a report with no inline evidence — output unchanged
  • Confirm figure numbering is correct (evidence images counted as figures alongside chart)

🤖 Generated with Claude Code

TheGr3atJosh and others added 2 commits May 9, 2026 21:55
Ghostwriter's TinyMCE stores inline evidence as:
  <div class="richtext-evidence" data-evidence-id="N"></div>

The previous resolver only handled the older {{.friendly_name}} tag
syntax, which is not emitted by current Ghostwriter versions. This
caused inline evidence to silently disappear from rendered PDFs.

Changes:
- _build_evidence_index now returns two indexes: by friendly_name and
  by numeric id, built in a single JSON walk
- _resolve_richtext_evidence replaces richtext-evidence divs with
  <figure><img><figcaption> using the id-based index
- Both resolvers run sequentially per field in make_vue_data; the
  {{.name}} resolver is kept for backwards compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant