Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14887 closed bug (notabug)

Possible bug for parseHTML

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0-rc1
Keywords: Cc:
Blocked by: Blocking:


When using parseHTML to parse a string with a single space, it returns an array with one HTMLDocument. Is that the right behavior? Should it be an array with no item?


Change History (2)

comment:1 Changed 9 years ago by anonymous

Understand it is handled as a TextNode and can be mitigated using Trim() before calling parseHTML.

Please close if this is expected.


comment:2 Changed 9 years ago by dmethvin

Resolution: notabug
Status: newclosed

It's a strange case but it's expected. We intentionally don't try to trim the string because we want to create any leading/trailing text nodes that may be created. Docs issue created at https://github.com/jquery/api.jquery.com/issues/462

Note: See TracTickets for help on using tickets.