Skip to content

Conversation

@haxtibal
Copy link
Contributor

For HTML escaping of the diff view we have to consider two things.

  1. Diff input comes from two git checkouts of the project at specific revisions. The revisions sdocs are considered untrusted user input, could contain special characters and must be escaped.
  2. After analyzing with difflib we add a bit HTML to colorize the output. This specific HTML fragments are trusted and safe.

Relates to #1920.

For HTML escaping of the diff view we have to consider two things.

1. Diff input comes from two git checkouts of the project at specific
   revisions. The revisions sdocs are considered untrusted user input,
   could contain special characters and must be escaped.
2. After analyzing with difflib we add a bit HTML to colorize the
   output. This specific HTML fragments are trusted and safe.

Relates to strictdoc-project#1920.
@haxtibal haxtibal force-pushed the tdmg/fix_diff_html_escaping branch from 80462b6 to a7d6ee4 Compare November 10, 2024 19:36
@stanislaw stanislaw changed the title WIP: Mark diff colors safe and escape raw diff input Mark diff colors safe and escape raw diff input Nov 10, 2024
@stanislaw stanislaw merged commit db0e4ff into strictdoc-project:main Nov 10, 2024
22 checks passed
@stanislaw stanislaw added this to the 2024-Q4 milestone Nov 10, 2024
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.

2 participants