You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move Spec Compliance section and improve formatting
- Move section after Usage, before Performance
- Add reference to justhtml having the same compliance
- Convert test results to table format
- Total: 8,953 tests passing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
-**Fragment Parsing** - Parse HTML fragments in specific contexts
16
16
17
-
## Spec Compliance
18
-
19
-
swift-justhtml implements the [WHATWG HTML parsing specification](https://html.spec.whatwg.org/multipage/parsing.html) exactly and passes all tests from the official [html5lib-tests](https://github.com/html5lib/html5lib-tests) suite used by browser vendors.
The parser has been fuzz tested with millions of randomized and malformed HTML documents to ensure it never crashes or hangs on any input:
48
-
49
-
- Random data fuzzing with varying document sizes
50
-
- Fragment context fuzzing
51
-
- Deep nesting stress tests
52
-
- Malformed tag and entity sequences
53
-
54
-
Run the fuzzer yourself:
55
-
```bash
56
-
swift test --filter fuzzTest
57
-
```
58
-
59
17
## Installation
60
18
61
19
### Swift Package Manager
@@ -171,6 +129,31 @@ for error in doc.errors {
171
129
}
172
130
```
173
131
132
+
## Spec Compliance
133
+
134
+
swift-justhtml implements the [WHATWG HTML parsing specification](https://html.spec.whatwg.org/multipage/parsing.html) exactly and passes all tests from the official [html5lib-tests](https://github.com/html5lib/html5lib-tests) suite (used by browser vendors), the same as [justhtml](https://github.com/EmilStenstrom/justhtml).
135
+
136
+
### Test Results
137
+
138
+
| Test Suite | Passed | Failed |
139
+
|------------|--------|--------|
140
+
| Tree Construction | 1,831 | 0 |
141
+
| Tokenizer | 6,810 | 0 |
142
+
| Serializer | 230 | 0 |
143
+
| Encoding | 82 | 0 |
144
+
|**Total**|**8,953**|**0**|
145
+
146
+
### Fuzz Testing
147
+
148
+
The parser has been fuzz tested with millions of randomized and malformed HTML documents to ensure it never crashes or hangs on any input:
149
+
150
+
- Random data fuzzing with varying document sizes
151
+
- Fragment context fuzzing
152
+
- Deep nesting stress tests
153
+
- Malformed tag and entity sequences
154
+
155
+
Run the fuzzer: `swift test --filter fuzzTest`
156
+
174
157
## Performance
175
158
176
159
swift-justhtml is optimized for performance, matching or exceeding JavaScript implementations:
0 commit comments