Skip to content

Commit fd88f8b

Browse files
committed
minor #13930 Update docs regarding 2nd argument of DomCrawler text() (DanielSiepmann)
This PR was submitted for the 5.1 branch but it was merged into the 5.0 branch instead. Discussion ---------- Update docs regarding 2nd argument of DomCrawler text() The 2nd Argument is true by default, therefore whitespace is trimmed by default. Passing false will alter the default behaviour. Previous documentation suggested the other way around. Commits ------- abcb183 Update docs regarding 2nd argument of DomCrawler text()
2 parents 0d44af3 + abcb183 commit fd88f8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/dom_crawler.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ Access the value of the first node of the current selection::
220220
// avoid the exception passing an argument that text() returns when node does not exist
221221
$message = $crawler->filterXPath('//body/p')->text('Default text content');
222222

223-
// pass TRUE as the second argument of text() to remove all extra white spaces, including
223+
// pass false as the second argument of text() to not remove all extra white spaces, including
224224
// the internal ones (e.g. " foo\n bar baz \n " is returned as "foo bar baz")
225-
$crawler->filterXPath('//body/p')->text('Default text content', true);
225+
$crawler->filterXPath('//body/p')->text('Default text content', false);
226226

227227
Access the attribute value of the first node of the current selection::
228228

0 commit comments

Comments
 (0)