Skip to content

Conversation

@tayu0110
Copy link

Hello, I have implemented the fix for issue #923 and would like to merge it into the master branch.

The PR primarily consists of fixes to reader::BangType::DocType and reader::BangType::parse, along with the addition of a small test to tests/issues.rs.

I believe these fixes will at least enable correct skipping of well-formed DTDs.

While adding checks for ill-formed DTDs might not be impossible, the current implementation lacks a mechanism for reader::BangType::parse to report errors. Since this would require significant changes, this update focuses solely on skipping well-formed DTD internal subsets without errors.

Thank you for your confirmation.

@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 75.34247% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.29%. Comparing base (d1acdb5) to head (a4c077d).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/reader/dtd.rs 74.88% 54 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #925      +/-   ##
==========================================
+ Coverage   58.08%   58.29%   +0.20%     
==========================================
  Files          42       43       +1     
  Lines       15513    15744     +231     
==========================================
+ Hits         9011     9178     +167     
- Misses       6502     6566      +64     
Flag Coverage Δ
unittests 58.29% <75.34%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@Mingun Mingun left a comment

Choose a reason for hiding this comment

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

I would like to see DTD code parsing in the separate file (src/reader/dtd.rs). So move DTDParseState to dtd.rs and

impl DTDParseState {
  fn feed(&mut self, chunk: &[u8]) {
    ...
  }
}

Also, it seems that this code crashed on some inputs, see the fuzzing results.

@tayu0110
Copy link
Author

Hi, thank you for your quick review :)
I have updated submitted codes as follows your advice.

I've hardly ever made pull requests before, so I'm not sure if I've updated it properly. Is it working okay?

@tayu0110 tayu0110 requested a review from Mingun December 22, 2025 17:03
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.

3 participants