diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..81c8efc9
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,37 @@
+# EditorConfig is awesome: https://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+trim_trailing_whitespace = true
+
+# Java files
+[*.java]
+indent_style = space
+indent_size = 4
+max_line_length = 120
+
+# XML files (pom.xml, etc.)
+[*.xml]
+indent_style = space
+indent_size = 4
+
+# YAML files
+[*.{yml,yaml}]
+indent_style = space
+indent_size = 2
+
+# Markdown files
+[*.md]
+trim_trailing_whitespace = false
+max_line_length = off
+
+# Properties files
+[*.properties]
+indent_style = space
+indent_size = 4
diff --git a/.gitattributes b/.gitattributes
index 4503aae3..69bda742 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,12 +1,37 @@
* text=auto
+# Source files
*.java text diff=java
+*.xml text
+*.properties text
+
+# Web files
*.html text diff=html
*.css text
*.js text
-*.xml text
-.travis.yml text
+# Documentation
+*.md text diff=markdown
+*.txt text
+
+# Configuration files
+*.yml text
+*.yaml text
+.editorconfig text
+.gitignore text
+.gitattributes text
+
+# Scripts
+*.sh text eol=lf
+*.bat text eol=crlf
+
+# Archives
+*.jar binary
+*.zip binary
+*.tar binary
+*.gz binary
+
+# Test files - specific binary files
src/test/resources/org/htmlunit/cyberneko/testfiles/test010.html binary
src/test/resources/org/htmlunit/cyberneko/testfiles/test011.html binary
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..dc75841d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,51 @@
+---
+name: Bug Report
+about: Create a report to help us improve
+title: '[BUG] '
+labels: bug
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Parse HTML with '...'
+2. Use parser configuration '....'
+3. Call method '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Code Example**
+```java
+// Minimal code example to reproduce the issue
+DOMParser parser = new DOMParser();
+// ...
+```
+
+**HTML Sample**
+```html
+
+
+
+...
+
+```
+
+**Environment (please complete the following information):**
+ - OS: [e.g. Windows 10, Ubuntu 20.04]
+ - Java Version: [e.g. 8, 11, 17]
+ - HtmlUnit NekoHTML Version: [e.g. 4.18.0]
+
+**Stack Trace**
+If applicable, add the full stack trace:
+```
+Exception in thread "main" ...
+```
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 00000000..8a387647
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,33 @@
+---
+name: Feature Request
+about: Suggest an idea for this project
+title: '[FEATURE] '
+labels: enhancement
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Use Case**
+Describe how this feature would be used in practice:
+```java
+// Example code showing how the feature would be used
+parser.setFeature(NEW_FEATURE, true);
+// ...
+```
+
+**Additional context**
+Add any other context, screenshots, or examples about the feature request here.
+
+**Would you be willing to implement this feature?**
+- [ ] Yes, I can submit a pull request
+- [ ] No, but I can help with testing
+- [ ] No, just suggesting the idea
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000..9d34ffb4
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,57 @@
+## Description
+
+
+## Type of Change
+
+- [ ] Bug fix (non-breaking change which fixes an issue)
+- [ ] New feature (non-breaking change which adds functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
+- [ ] Documentation update
+- [ ] Code quality improvement
+- [ ] Performance improvement
+
+## Related Issue
+
+Fixes #(issue number)
+
+## Changes Made
+
+-
+-
+-
+
+## Testing
+
+- [ ] All existing tests pass (`mvn test`)
+- [ ] Added new tests for the changes
+- [ ] Tested with various Java versions (8, 11, 17, 21)
+- [ ] Manual testing performed
+
+### Test Cases Added
+
+-
+-
+
+## Quality Checks
+
+- [ ] Code follows the project's code style (`mvn checkstyle:check`)
+- [ ] No new SpotBugs warnings (`mvn spotbugs:check`)
+- [ ] No new PMD violations (`mvn pmd:check`)
+- [ ] JavaDoc added/updated for public APIs
+- [ ] README.md updated (if applicable)
+
+## Screenshots (if applicable)
+
+
+## Additional Notes
+
+
+## Checklist
+- [ ] My code follows the style guidelines of this project
+- [ ] I have performed a self-review of my own code
+- [ ] I have commented my code, particularly in hard-to-understand areas
+- [ ] I have made corresponding changes to the documentation
+- [ ] My changes generate no new warnings
+- [ ] I have added tests that prove my fix is effective or that my feature works
+- [ ] New and existing unit tests pass locally with my changes
+- [ ] Any dependent changes have been merged and published
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..e52f5b60
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,108 @@
+name: CI Build
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+ name: Build and Test
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
+ strategy:
+ matrix:
+ java: ['8', '11', '17', '21']
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: 'temurin'
+ cache: 'maven'
+
+ - name: Build with Maven
+ run: mvn -B clean compile --file pom.xml
+
+ - name: Run tests
+ run: mvn -B test --file pom.xml
+
+ - name: Generate test report
+ if: always()
+ run: mvn surefire-report:report-only
+
+ - name: Upload test results
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: test-results-java-${{ matrix.java }}
+ path: target/surefire-reports/
+ retention-days: 7
+
+ - name: Upload coverage report
+ if: matrix.java == '8'
+ uses: actions/upload-artifact@v4
+ with:
+ name: coverage-report
+ path: target/site/jacoco/
+ retention-days: 30
+
+ quality:
+ name: Code Quality Checks
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 8
+ uses: actions/setup-java@v4
+ with:
+ java-version: '8'
+ distribution: 'temurin'
+ cache: 'maven'
+
+ - name: Compile code
+ run: mvn -B clean compile --file pom.xml
+
+ - name: Run Checkstyle
+ run: mvn checkstyle:checkstyle --file pom.xml
+ continue-on-error: true
+
+ - name: Upload Checkstyle report
+ uses: actions/upload-artifact@v4
+ with:
+ name: checkstyle-report
+ path: target/checkstyle-result.xml
+ retention-days: 7
+
+ - name: Run SpotBugs
+ run: mvn spotbugs:spotbugs --file pom.xml
+ continue-on-error: true
+
+ - name: Upload SpotBugs report
+ uses: actions/upload-artifact@v4
+ with:
+ name: spotbugs-report
+ path: target/spotbugsXml.xml
+ retention-days: 7
+
+ - name: Run PMD
+ run: mvn pmd:pmd --file pom.xml
+ continue-on-error: true
+
+ - name: Upload PMD report
+ uses: actions/upload-artifact@v4
+ with:
+ name: pmd-report
+ path: target/pmd.xml
+ retention-days: 7
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index ce837688..3bb5bcec 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -30,20 +30,18 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v2
- with:
- # We must fetch at least the immediate parents so that if this is
- # a pull request then we can checkout the head.
- fetch-depth: 2
+ uses: actions/checkout@v4
- # If this run was triggered by a pull request event, then checkout
- # the head of the pull request instead of the merge commit.
- - run: git checkout HEAD^2
- if: ${{ github.event_name == 'pull_request' }}
+ - name: Set up JDK 8
+ uses: actions/setup-java@v4
+ with:
+ java-version: '8'
+ distribution: 'temurin'
+ cache: 'maven'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +52,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@v2
+ uses: github/codeql-action/autobuild@v3
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -68,4 +66,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml
new file mode 100644
index 00000000..0aa0d1a1
--- /dev/null
+++ b/.github/workflows/dependency-check.yml
@@ -0,0 +1,31 @@
+name: Dependency Check
+
+on:
+ schedule:
+ # Run weekly on Mondays at 2 AM UTC
+ - cron: '0 2 * * 1'
+ workflow_dispatch:
+
+jobs:
+ dependency-check:
+ name: Check Dependencies for Vulnerabilities
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up JDK 8
+ uses: actions/setup-java@v4
+ with:
+ java-version: '8'
+ distribution: 'temurin'
+ cache: 'maven'
+
+ - name: Check for dependency updates
+ run: mvn versions:display-dependency-updates
+
+ - name: Check for plugin updates
+ run: mvn versions:display-plugin-updates
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
new file mode 100644
index 00000000..87b42834
--- /dev/null
+++ b/.github/workflows/stale.yml
@@ -0,0 +1,51 @@
+name: Manage Stale Issues and PRs
+
+on:
+ schedule:
+ - cron: '0 0 * * *' # Run daily at midnight UTC
+ workflow_dispatch:
+
+jobs:
+ stale:
+ runs-on: ubuntu-latest
+ permissions:
+ issues: write
+ pull-requests: write
+
+ steps:
+ - uses: actions/stale@v9
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+
+ # Issue settings
+ days-before-issue-stale: 180
+ days-before-issue-close: 30
+ stale-issue-label: 'stale'
+ stale-issue-message: >
+ This issue has been automatically marked as stale because it has not had
+ recent activity. It will be closed if no further activity occurs within the
+ next 30 days. If you believe this issue is still relevant, please leave a
+ comment and we will remove the stale label.
+ close-issue-message: >
+ This issue was automatically closed due to inactivity. If you believe this
+ issue should remain open, please reopen it with additional information.
+
+ # Pull Request settings
+ days-before-pr-stale: 90
+ days-before-pr-close: 14
+ stale-pr-label: 'stale'
+ stale-pr-message: >
+ This pull request has been automatically marked as stale because it has not had
+ recent activity. It will be closed if no further activity occurs within the
+ next 14 days. If you would like to continue working on this PR, please rebase
+ and update it.
+ close-pr-message: >
+ This pull request was automatically closed due to inactivity. If you would like
+ to continue this work, please reopen the PR or create a new one.
+
+ # Exempt labels
+ exempt-issue-labels: 'pinned,security,bug,enhancement'
+ exempt-pr-labels: 'pinned,security,in-progress'
+
+ # Operations per run
+ operations-per-run: 100
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..776c7cd1
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,122 @@
+# Contributing to HtmlUnit NekoHTML Parser
+
+First off, thank you for considering contributing to HtmlUnit NekoHTML Parser!
+
+## How Can I Contribute?
+
+### Reporting Bugs
+
+Before creating bug reports, please check the existing issues to avoid duplicates. When creating a bug report, include:
+
+* **Use a clear and descriptive title**
+* **Describe the exact steps to reproduce the problem**
+* **Provide specific examples** - Include code snippets and sample HTML
+* **Describe the behavior you observed** and what you expected to see
+* **Include your environment details** - Java version, OS, etc.
+
+### Suggesting Enhancements
+
+Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
+
+* **Use a clear and descriptive title**
+* **Provide a detailed description** of the suggested enhancement
+* **Explain why this enhancement would be useful** to most users
+* **List some examples** of how it would be used
+
+### Pull Requests
+
+1. **Fork the repository** and create your branch from `master`
+2. **Follow the existing code style** - Use the Checkstyle configuration
+3. **Write clear commit messages** - Use the imperative mood ("Add feature" not "Added feature")
+4. **Include tests** - Add tests for new functionality or bug fixes
+5. **Update documentation** - Update README.md or comments as needed
+6. **Run all tests** before submitting: `mvn clean test`
+7. **Run quality checks**: `mvn checkstyle:check spotbugs:check pmd:check`
+
+## Development Setup
+
+### Prerequisites
+
+You need:
+* JDK 8 or higher
+* Maven 3.6.3 or higher
+* Git
+
+### Building the Project
+
+```bash
+# Clone your fork
+git clone https://github.com/YOUR-USERNAME/htmlunit-neko.git
+cd htmlunit-neko
+
+# Build the project
+mvn clean compile
+
+# Run tests
+mvn test
+
+# Run all quality checks
+mvn checkstyle:check spotbugs:check pmd:check
+```
+
+## Code Style Guidelines
+
+* **Follow the existing code style** in the project
+* **Use meaningful variable and method names**
+* **Add comments for complex logic**, but prefer self-documenting code
+* **Keep methods focused** - Each method should do one thing
+* **Add Javadoc** for public APIs
+* **Follow Java naming conventions**:
+ * Classes: `PascalCase`
+ * Methods/variables: `camelCase`
+ * Constants: `UPPER_SNAKE_CASE`
+
+## Testing Guidelines
+
+* **Write unit tests** for new functionality
+* **Use descriptive test method names** - e.g., `testParseHtmlWithMissingClosingTags()`
+* **Follow the Arrange-Act-Assert pattern**
+* **Test edge cases** - Empty input, malformed HTML, etc.
+* **Ensure all tests pass** before submitting a PR
+
+## Quality Checks
+
+The project uses several quality tools:
+
+* **Checkstyle** - Code style checking
+* **SpotBugs** - Static analysis for bugs
+* **PMD** - Code quality analysis
+
+Run them with: `mvn checkstyle:check spotbugs:check pmd:check`
+
+Note: There are currently known violations that are being addressed. Your PR should not introduce new violations.
+
+## Commit Message Guidelines
+
+* Use the present tense ("Add feature" not "Added feature")
+* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
+* Limit the first line to 72 characters or less
+* Reference issues and pull requests when relevant
+
+Example:
+```
+Fix parsing of nested tables in malformed HTML
+
+- Handle cases where table elements are not properly closed
+- Add test case for nested table parsing
+- Update documentation
+
+Fixes #123
+```
+
+## License
+
+By contributing, you agree that your contributions will be licensed under the Apache License 2.0.
+
+## Questions?
+
+Feel free to open an issue with your question or reach out to the maintainers.
+
+## Attribution
+
+This Contributing guide is adapted from the [Atom Contributing Guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md).
diff --git a/README.md b/README.md
index c0f4dbb2..0b5fa162 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,27 @@
# Htmlunit-NekoHtml Parser
+[](https://central.sonatype.com/artifact/org.htmlunit/neko-htmlunit)
+[](https://jenkins.wetator.org/view/HtmlUnit/job/HtmlUnit%20-%20Neko/)
+[](https://opensource.org/licenses/Apache-2.0)
+[](https://www.oracle.com/java/)
+
The **Htmlunit-NekoHtml** Parser is a HTML scanner and tag balancer that enables application programmers to parse HTML documents
and access the information using standard XML interfaces.
The parser can scan HTML files and "fix up" many common mistakes that human (and computer) authors make in writing HTML documents.
NekoHTML adds missing parent elements; automatically closes elements with optional end tags; and can handle mismatched inline element tags.
-The **Htmlunit-NekoHtml** Parser has no external dependencies at all, requires Java 8 and works also on Android.
-The **Htmlunit-NekoHtml** Parser is used by Htmlunit.
+## Key Features
-[](https://central.sonatype.com/artifact/org.htmlunit/neko-htmlunit)
+â
**No External Dependencies** - Pure Java implementation
+â
**Java 8+ Compatible** - Works with Java 8, 11, 17, 21 and beyond
+â
**Android Support** - Runs on Android platforms
+â
**Error Tolerant** - Handles malformed HTML gracefully
+â
**Standards Compliant** - Follows HTML parsing specifications
+â
**Well Tested** - Over 8,000 test cases
-:heart: [Sponsor](https://github.com/sponsors/rbri)
+The **Htmlunit-NekoHtml** Parser is used by [HtmlUnit](https://htmlunit.sourceforge.io/).
+
+:heart: [Sponsor this project](https://github.com/sponsors/rbri)
### Project News
@@ -20,9 +31,12 @@ The **Htmlunit-NekoHtml** Parser is used by Htmlunit.
### Latest release Version 4.18.0 / October 30, 2025
-##### [CVE-2022-29546](https://nvd.nist.gov/vuln/detail/CVE-2022-29546)
+##### Security Advisories
+
+[CVE-2022-29546](https://nvd.nist.gov/vuln/detail/CVE-2022-29546): Fixed in versions 2.61.0+
Htmlunit-NekoHtml Parser suffers from a denial of service vulnerability on versions 2.60.0 and below. A specifically crafted input regarding the parsing of processing instructions leads to heap memory consumption.
-##### [CVE-2022-28366](https://nvd.nist.gov/vuln/detail/CVE-2022-28366)
+
+[CVE-2022-28366](https://nvd.nist.gov/vuln/detail/CVE-2022-28366): Fixed in versions 2.27+
Htmlunit-NekoHtml Parser suffers from a denial of service via crafted Processing Instruction vulnerability on versions 2.26 and below.
## Get it!
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000..e8c6a763
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,79 @@
+# Security Policy
+
+## Supported Versions
+
+We actively support the following versions of HtmlUnit NekoHTML Parser:
+
+| Version | Supported |
+| ------- | ------------------ |
+| 4.x | :white_check_mark: |
+| 3.x | :white_check_mark: |
+| < 3.0 | :x: |
+
+## Reporting a Vulnerability
+
+We take security vulnerabilities seriously. If you discover a security vulnerability in HtmlUnit NekoHTML Parser, please follow these steps:
+
+### 1. Do Not Open a Public Issue
+
+Please **do not** open a public GitHub issue for security vulnerabilities, as this could put users at risk.
+
+### 2. Report Privately
+
+Report security vulnerabilities privately through one of these methods:
+
+- **GitHub Security Advisories**: Use GitHub's [private vulnerability reporting](https://github.com/HtmlUnit/htmlunit-neko/security/advisories/new)
+- **Email**: Send an email to the project maintainer at rbri@rbri.de
+
+### 3. What to Include
+
+When reporting a vulnerability, please include:
+
+- A description of the vulnerability
+- Steps to reproduce the issue
+- Affected versions
+- Any potential impact
+- Suggested fix (if you have one)
+- Your contact information for follow-up questions
+
+### 4. What to Expect
+
+- **Acknowledgment**: We will acknowledge receipt of your report within 3 business days
+- **Updates**: We will provide regular updates on the status of the vulnerability
+- **Timeline**: We aim to address critical vulnerabilities within 30 days
+- **Credit**: With your permission, we will credit you in the security advisory and release notes
+
+## Security Best Practices
+
+When using HtmlUnit NekoHTML Parser:
+
+1. **Keep Updated**: Always use the latest stable version
+2. **Monitor Advisories**: Subscribe to security advisories for this repository
+3. **Input Validation**: Validate and sanitize HTML input from untrusted sources
+4. **Resource Limits**: Implement timeouts and resource limits when parsing untrusted HTML
+5. **Dependency Scanning**: Regularly scan your dependencies for known vulnerabilities
+
+## Known Security Issues
+
+### Fixed Vulnerabilities
+
+- **[CVE-2022-29546](https://nvd.nist.gov/vuln/detail/CVE-2022-29546)**: Denial of service via processing instructions (Fixed in 2.61.0+)
+- **[CVE-2022-28366](https://nvd.nist.gov/vuln/detail/CVE-2022-28366)**: Denial of service via crafted processing instruction (Fixed in 2.27+)
+
+## Security Update Process
+
+When a security vulnerability is confirmed:
+
+1. We develop and test a fix
+2. We prepare a security advisory
+3. We release a patched version
+4. We publish the security advisory
+5. We notify users through multiple channels
+
+## Questions?
+
+If you have questions about this security policy or the security of HtmlUnit NekoHTML Parser, please open a discussion or contact the maintainers.
+
+## Attribution
+
+Thank you to all security researchers who have responsibly disclosed vulnerabilities to us.
diff --git a/pom.xml b/pom.xml
index f53a2769..82675de9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,7 @@
3.2.8
3.6.2
3.14.1
- 3.4.2
+ 3.5.0
3.12.0
3.5.4
@@ -228,7 +228,6 @@
-
org.apache.maven.plugins
maven-enforcer-plugin
diff --git a/src/main/java/org/htmlunit/cyberneko/sax/helpers/package-info.java b/src/main/java/org/htmlunit/cyberneko/sax/helpers/package-info.java
new file mode 100644
index 00000000..968a9005
--- /dev/null
+++ b/src/main/java/org/htmlunit/cyberneko/sax/helpers/package-info.java
@@ -0,0 +1,6 @@
+/**
+ * SAX helper classes for HtmlUnit NekoHTML Parser.
+ * This package contains utility classes that provide SAX parsing functionality
+ * compatible with the HtmlUnit NekoHTML Parser.
+ */
+package org.htmlunit.cyberneko.sax.helpers;
diff --git a/src/test/java/org/htmlunit/cyberneko/DOMFragmentParserTest.java b/src/test/java/org/htmlunit/cyberneko/DOMFragmentParserTest.java
index 1c72a691..5ca5dff1 100644
--- a/src/test/java/org/htmlunit/cyberneko/DOMFragmentParserTest.java
+++ b/src/test/java/org/htmlunit/cyberneko/DOMFragmentParserTest.java
@@ -93,6 +93,9 @@ private static void doTest(final String html, final String expected) throws Exce
assertEquals(expected, str);
}
+ // Utility method for debugging - prints the node tree structure
+ // Uncomment when needed for debugging purposes
+ /*
public static void print(final Node node, final String indent) {
System.out.println(indent + node.getClass().getName());
Node child = node.getFirstChild();
@@ -101,6 +104,7 @@ public static void print(final Node node, final String indent) {
child = child.getNextSibling();
}
}
+ */
/**
* HTMLTagBalancer field fSeenBodyElementEnd was not correctly reset as of 1.19.17.
diff --git a/src/test/java/org/htmlunit/cyberneko/ReadmeTest.java b/src/test/java/org/htmlunit/cyberneko/ReadmeTest.java
index 177f683b..c6741794 100644
--- a/src/test/java/org/htmlunit/cyberneko/ReadmeTest.java
+++ b/src/test/java/org/htmlunit/cyberneko/ReadmeTest.java
@@ -15,6 +15,8 @@
*/
package org.htmlunit.cyberneko;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
import java.io.IOException;
import java.io.StringReader;
@@ -56,7 +58,8 @@ public void domParser() throws Exception {
final HTMLDocumentImpl doc = (HTMLDocumentImpl) parser.getDocument();
final NodeList headings = doc.getElementsByTagName("h1");
- System.out.println(headings.item(0));
+ // Verify we found the heading
+ assertNotNull(headings.item(0));
}
@Test
diff --git a/src/test/java/org/htmlunit/cyberneko/filters/package-info.java b/src/test/java/org/htmlunit/cyberneko/filters/package-info.java
new file mode 100644
index 00000000..674af886
--- /dev/null
+++ b/src/test/java/org/htmlunit/cyberneko/filters/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * Test classes for filter functionality.
+ * This package contains tests for various HTML filtering operations.
+ */
+package org.htmlunit.cyberneko.filters;
diff --git a/src/test/java/org/htmlunit/cyberneko/io/package-info.java b/src/test/java/org/htmlunit/cyberneko/io/package-info.java
new file mode 100644
index 00000000..e817bc62
--- /dev/null
+++ b/src/test/java/org/htmlunit/cyberneko/io/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * Test classes for I/O operations.
+ * This package contains tests for input/output stream handling.
+ */
+package org.htmlunit.cyberneko.io;
diff --git a/src/test/java/org/htmlunit/cyberneko/package-info.java b/src/test/java/org/htmlunit/cyberneko/package-info.java
new file mode 100644
index 00000000..84617355
--- /dev/null
+++ b/src/test/java/org/htmlunit/cyberneko/package-info.java
@@ -0,0 +1,6 @@
+/**
+ * Test classes for HtmlUnit NekoHTML Parser.
+ * This package contains various test cases to verify the functionality
+ * of the HTML parser.
+ */
+package org.htmlunit.cyberneko;
diff --git a/src/test/java/org/htmlunit/cyberneko/util/package-info.java b/src/test/java/org/htmlunit/cyberneko/util/package-info.java
new file mode 100644
index 00000000..058ab14a
--- /dev/null
+++ b/src/test/java/org/htmlunit/cyberneko/util/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * Test classes for utility classes.
+ * This package contains tests for various utility functions.
+ */
+package org.htmlunit.cyberneko.util;
diff --git a/src/test/java/org/htmlunit/cyberneko/xerces/dom/package-info.java b/src/test/java/org/htmlunit/cyberneko/xerces/dom/package-info.java
new file mode 100644
index 00000000..fbb53359
--- /dev/null
+++ b/src/test/java/org/htmlunit/cyberneko/xerces/dom/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * Test classes for DOM implementation.
+ * This package contains tests for the HTML DOM implementation.
+ */
+package org.htmlunit.cyberneko.xerces.dom;
diff --git a/src/test/java/org/htmlunit/cyberneko/xerces/util/package-info.java b/src/test/java/org/htmlunit/cyberneko/xerces/util/package-info.java
new file mode 100644
index 00000000..cfef1db9
--- /dev/null
+++ b/src/test/java/org/htmlunit/cyberneko/xerces/util/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * Test classes for Xerces utility classes.
+ * This package contains tests for encoding translation and other utilities.
+ */
+package org.htmlunit.cyberneko.xerces.util;
diff --git a/src/test/java/org/htmlunit/cyberneko/xerces/xni/package-info.java b/src/test/java/org/htmlunit/cyberneko/xerces/xni/package-info.java
new file mode 100644
index 00000000..523563dc
--- /dev/null
+++ b/src/test/java/org/htmlunit/cyberneko/xerces/xni/package-info.java
@@ -0,0 +1,5 @@
+/**
+ * Test classes for XML string operations.
+ * This package contains tests for Xerces XNI XMLString functionality.
+ */
+package org.htmlunit.cyberneko.xerces.xni;