Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty HTML tags are not removed by .text() #2102

Open
henricook opened this issue Jan 12, 2024 · 0 comments
Open

Empty HTML tags are not removed by .text() #2102

henricook opened this issue Jan 12, 2024 · 0 comments

Comments

@henricook
Copy link

henricook commented Jan 12, 2024

This unit test (scalatest) fails:

      "work on empty tag content" in {
        val input    = "< />"
        val expected = ""

        val parsed = Jsoup.parse(input).text()

        parsed should be(expected)
      }

The output of Jsoup.parse(input).text() is < />

I think I'd expect this empty HTML tag to be removed - WDYT?

Edit: I appreciate this isn't really a valid HTML tag and you would be well within your rights to tell me it's out of scope for Jsoup as a result!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant