Skip to content

Commit 7bf47ad

Browse files
committed
Merge branch '5.1'
* 5.1: Update docs regarding 2nd argument of DomCrawler text()
2 parents ee1139e + 2a190e9 commit 7bf47ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/dom_crawler.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ 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
224-
// 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);
223+
// by default, text() trims white spaces, including the internal ones
224+
// (e.g. " foo\n bar baz \n " is returned as "foo bar baz")
225+
// pass FALSE as the second argument to return the original text unchanged
226+
$crawler->filterXPath('//body/p')->text('Default text content', false);
226227

227228
Access the attribute value of the first node of the current selection::
228229

0 commit comments

Comments
 (0)