Commit 17da187
committed
Enable control for tokenizer buffer size
This change adds an optional bufferSize parameter to the tokenize(), parse(),
and parseFragment() methods of sax.HtmlParser instances. That bufferSize
parameter controls the size of the buffer which gets fed to the tokenizer.
The control provided by that parameter allows the tokenizer buffer to be
set, for example, to "1" — and that is particularly useful for emulating
the behavior of the Firefox HTML parser, which feeds the tokenizer one
single code unit at a time.
Otherwise, without this change, the tokenizer buffer size for HtmlParser
instances is hardcoded to 2048.1 parent 3f48926 commit 17da187
File tree
2 files changed
+76
-7
lines changed- src/nu/validator/htmlparser
- io
- sax
2 files changed
+76
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
176 | 194 | | |
177 | 195 | | |
178 | 196 | | |
| |||
216 | 234 | | |
217 | 235 | | |
218 | 236 | | |
219 | | - | |
| 237 | + | |
220 | 238 | | |
221 | 239 | | |
222 | 240 | | |
| |||
270 | 288 | | |
271 | 289 | | |
272 | 290 | | |
273 | | - | |
274 | | - | |
| 291 | + | |
| 292 | + | |
275 | 293 | | |
276 | 294 | | |
277 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
405 | 412 | | |
406 | 413 | | |
407 | 414 | | |
408 | | - | |
| 415 | + | |
409 | 416 | | |
410 | 417 | | |
411 | 418 | | |
| |||
426 | 433 | | |
427 | 434 | | |
428 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
429 | 449 | | |
430 | 450 | | |
431 | 451 | | |
432 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
433 | 457 | | |
434 | 458 | | |
435 | 459 | | |
| |||
449 | 473 | | |
450 | 474 | | |
451 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
452 | 491 | | |
453 | 492 | | |
454 | 493 | | |
455 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
456 | 499 | | |
457 | 500 | | |
458 | 501 | | |
| |||
468 | 511 | | |
469 | 512 | | |
470 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
471 | 518 | | |
472 | 519 | | |
473 | 520 | | |
| |||
485 | 532 | | |
486 | 533 | | |
487 | 534 | | |
488 | | - | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
489 | 540 | | |
490 | 541 | | |
491 | 542 | | |
| |||
0 commit comments