com.gargoylesoftware.htmlunit.html.DomNode.asText() returns nested elements with linebreaks
See original GitHub issueIn the case of nested elements, the text of span element is output with linebreaks:
<span>
<select name="day" size="1">...</select>
<select name="month" size="1">...</select>
<select name="year" size="1">...</select>
</span>
output: 1 JAN 2021
Therefore, real line breaks, like < /br> cannot be distinguished in output text from blocks. This worked fine in the earlier versions like 2.18 It seems that the status is set incorrectly after a block, see: com.gargoylesoftware.htmlunit.html.HtmlSerializer.HtmlSerializerTextBuilder.append(String, Mode)
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Changes - HtmlUnit - SourceForge
DomNode #asText() is now deprecated. rbri. Update, HtmlSerializerVisibleText moved into separate package 'com.gargoylesoftware.htmlunit.html.serializer'.
Read more >DomNode (HtmlUnit 2.67.0 API) - SourceForge
Returns a string representation of the XML document from this element and all it's children (recursively). protected void, basicRemove().
Read more >HtmlElement (HtmlUnit 2.67.0 API)
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode ... Appends a child element to this HTML element with the specified tag name if this ...
Read more >HtmlMark (HtmlUnit 2.67.0 API)
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html ... Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode.
Read more >DomElement (HtmlUnit 2.67.0 API)
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode ... Returns the first child element node of this element. String · getId().
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @dennisduysak ,
this is work in progress, i have not done much on this. The plan is
But please keep in mind i do all this in my spare time, having a real >40h per week job - means any help is welcome.
Hi @rbri , I saw that the changes for the select tags are already commited. Thanks a lot for this! However, the tables are still incorrectly formatted (see unit tests of HtmlTableTest.java in coment before). Is it possible to format them in the same way like the select tags?