Skip to content

Commit f2dc408

Browse files
committed
Add the versionadded directive
1 parent 982c8d5 commit f2dc408

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/dom_crawler.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Access the value of the first node of the current selection::
230230
// descendant of the current node, excluding text from child nodes
231231
$text = $crawler->filterXPath('//body/p')->innerText();
232232
// if content is <p>Foo <span>Bar</span></p> or <p><span>Bar</span> Foo</p>
233-
// innerText() returns 'Foo' and text() returns 'Foo Bar' respectively 'Bar Foo'
233+
// innerText() returns 'Foo' in both cases; and text() returns 'Foo Bar' and 'Bar Foo' respectively
234234

235235
// if there are multiple text nodes, between other child nodes, like
236236
// <p>Foo <span>Bar</span> Baz</p>
@@ -240,6 +240,11 @@ Access the value of the first node of the current selection::
240240
// but you can get the unchanged text by passing FALSE as argument
241241
$text = $crawler->filterXPath('//body/p')->innerText(false);
242242

243+
.. versionadded:: 6.3
244+
245+
The removal of whitespace characters by default in ``innerText()`` was
246+
introduced in Symfony 6.3.
247+
243248
Access the attribute value of the first node of the current selection::
244249

245250
$class = $crawler->filterXPath('//body/p')->attr('class');

0 commit comments

Comments
 (0)