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
PostContextinterface with optionalauthor/permlinkfields - Update
TagTransformingSanitizer.sanitize()to accept and use context - Update warning messages to include
formatPostContext()output - Export
PostContexttype from renderer package - Update
DefaultRenderer.render()signature to pass context - Update
RendererContainercomponent to accept/passpermlinkprop - Update
content.tsxandcomment-list-item.tsxcall 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