Repository navigation
fix: preserve styling and images in URL-ingested citation pages - #2398
Merged
Roopan-Microsoft merged 2 commits intoOct 8, 2026
Merged
Conversation
PadhiAjit-Microsoft
had a problem deploying
to
production
October 8, 2026 11:13 — with
GitHub Actions
Failure
PadhiAjit-Microsoft
marked this pull request as ready for review
October 8, 2026 11:53
PadhiAjit-Microsoft
had a problem deploying
to
production
October 8, 2026 11:53 — with
GitHub Actions
Failure
Roopan-Microsoft
approved these changes
Oct 8, 2026
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
HTML snapshot preparation and security:
_prepare_html_snapshotfunction to inject a<base href>(for resolving relative URLs) and a strict Content Security Policy<meta>(to prevent script execution) into HTML pages before storage. This ensures that when the stored HTML is viewed, it renders with correct styling and images but cannot execute scripts.ingest_urlto apply_prepare_html_snapshotto HTML content only, leaving other file types (e.g., PDFs) unchanged. [1] [2]Testing improvements:
_prepare_html_snapshot, covering correct injection after<head>or<html>, proper escaping of the source URL, and ensuring non-HTML files are unmodified._prepare_html_snapshotbefore upload, and non-HTML content remains untouched.Imports and refactoring:
htmlandParserKeyto support the new logic. [1] [2]Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information