Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix html escaping of source line marks #1929

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

haxtibal
Copy link
Contributor

SourceFileViewHTMLGenerator escaping code had multiple issues:

  • When marking each line from range_start_pragma_processor as safe, we wrapped not only strings but also whole tuples in Markup().
  • For tuple elements we didn't differentiate whether they from pygments (already escaped) or from source file (not yet escaped). Only the later must be explicitly escaped.

Relates to #1921.

@haxtibal haxtibal force-pushed the tdmg/fix_sdoc_fileref branch from b5ba85e to bf65922 Compare July 26, 2024 15:45
@haxtibal haxtibal force-pushed the tdmg/fix_sdoc_fileref branch 2 times, most recently from 83afcc7 to dcc30f4 Compare July 27, 2024 18:27
SourceFileViewHTMLGenerator escaping code had multiple issues:

- When marking each line from range_start_pragma_processor as safe, we
  wrapped not only strings but also whole tuples in Markup().
- For tuple elements we didn't differentiate whether they from pygments
  (already escaped) or from source file (not yet escaped). Only the
  later must be explicitly escaped.

Some changes are there to make mypy happy.

Relates to strictdoc-project#1921.
@haxtibal haxtibal force-pushed the tdmg/fix_sdoc_fileref branch from dcc30f4 to 134b9a1 Compare July 28, 2024 09:09
@haxtibal
Copy link
Contributor Author

This failed MacOS e2e test looks unrelated. I'm not on MacOS, can't reproduce locally. Do you know what's up?

@stanislaw
Copy link
Collaborator

This failed MacOS e2e test looks unrelated. I'm not on MacOS, can't reproduce locally. Do you know what's up?

It is one of the tests that are known to be flaky. They fail sometimes. Most of the time they are timeout errors of some kind but not always. I track the known ones here, and this one didn't fail before: #1912.

I just restarted the macOS tests and they have all passed.

Copy link
Collaborator

@stanislaw stanislaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for adding the integration tests. I checked both tests' outputs locally, and everything seems to be correct.

I edited your issue to track the remaining items where the other areas have to be double-checked with respect to HTML escaping:

#1920

@stanislaw stanislaw merged commit 96001e7 into strictdoc-project:main Jul 28, 2024
23 checks passed
@stanislaw stanislaw added this to the 2024-Q3 milestone Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants