Add post context to content-renderer sanitization warnings

Closes #763

Summary

  • Include author and permlink in renderer warning messages to identify which posts trigger blocked iframe/image warnings
  • Previously warnings like "Blocked image (invalid src)" gave no indication of which post content caused the issue
  • Now warnings include context like Blocked iframe (not whitelisted) in @author/permlink: src="..."

Changes

  • Add PostContext interface with optional author/permlink fields
  • Update TagTransformingSanitizer.sanitize() to accept and use context
  • Update warning messages to include formatPostContext() output
  • Export PostContext type from renderer package
  • Update DefaultRenderer.render() signature to pass context
  • Update RendererContainer component to accept/pass permlink prop
  • Update content.tsx and comment-list-item.tsx call sites

Test plan

  • Deploy and check logs for warnings - should now include post context
  • Verify posts with invalid images show warning with @author/permlink
  • Verify posts with non-whitelisted iframes show warning with context
Edited by gandalf_automation

Merge request reports

Loading