Skip to content

com.gargoylesoftware.htmlunit.html.DomNode.asText() returns nested elements with linebreaks #315

@Deadc00l

Description

@Deadc00l

In 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions