Commit 3b68bc5
committed
Define an option so loadHTML does not drop whitespace
Certain builds of PHP seem to drop specific whitespace during the HTML
parsing step. There seems to be no reason for this and the behaviour
has been seen for versions of PHP ranging all the way from 5.6 to 7.3.
The behaviour seems to be sidestepped by providing any supported
parsing option to the loadHTML method. LIBXML_NOWARNING was chosen as
it seemed like it would have the least impact overall.
For a PHP test to surface the behaviour, as well as the test of the
effect of constants please see:
https://gist.github.com/Zegnat/a94489e9b7d5501193e724e336bc6052
Huge thanks to everyone in #indieweb-dev who went on this journey with
me! Especially @cweiske and @Lewiscowles1986 for all the extra
testing, and @gRegorLove for getting the ball rolling with
parsing options.1 parent 784b6a6 commit 3b68bc5
2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
821 | 821 | | |
822 | | - | |
| 822 | + | |
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| |||
0 commit comments