File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ Access the value of the first node of the current selection::
230
230
// descendant of the current node, excluding text from child nodes
231
231
$text = $crawler->filterXPath('//body/p')->innerText();
232
232
// 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
234
234
235
235
// if there are multiple text nodes, between other child nodes, like
236
236
// <p>Foo <span>Bar</span> Baz</p>
@@ -240,6 +240,11 @@ Access the value of the first node of the current selection::
240
240
// but you can get the unchanged text by passing FALSE as argument
241
241
$text = $crawler->filterXPath('//body/p')->innerText(false);
242
242
243
+ .. versionadded :: 6.3
244
+
245
+ The removal of whitespace characters by default in ``innerText() `` was
246
+ introduced in Symfony 6.3.
247
+
243
248
Access the attribute value of the first node of the current selection::
244
249
245
250
$class = $crawler->filterXPath('//body/p')->attr('class');
You can’t perform that action at this time.
0 commit comments