Skip to content

Commit f58fbc3

Browse files
committed
Don't wrap lines when recovering with tidy
Unfortunately, I've seen downstream legacy code that makes assumptions on where linebreaks are (and where not), and this code must be run *after* we've processed the content here. So, try to avoid any unnecessary changes to the input.
1 parent da6ebfa commit f58fbc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Integration/XPathHelperFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function createHelper()
4343
if (function_exists('tidy_repair_string')) {
4444
$this->logger->notice('Failed parsing the legacy response as XHTML, trying to clean up with Tidy.', ['exception' => $exception, 'legacy_response' => $exception->getXmlInput()]);
4545

46-
return new XPathHelper($this->parser, tidy_repair_string($content, ['output-xhtml' => true], 'utf8'));
46+
return new XPathHelper($this->parser, tidy_repair_string($content, ['output-xhtml' => true, 'wrap' => 0], 'utf8'));
4747
} else {
4848
$this->logger->warning('Failed to process legacy response as XHTML.', ['exception' => $exception, 'legacy_response' => $exception->getXmlInput()]);
4949

0 commit comments

Comments
 (0)