How parse quasi-html text in java?

java, parsing

Solution

Use jsoup and enjoy the ease of use.

Problem

The quasi html text, looks like: `Simple<br> text <b>simple</b> text simple <BR><BR>text simple text`, I would like to parse it and create dom document. But problem is with unclosed tags, when I try this: ``` DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); InputSource source = new InputSource(new StringReader( Document doc = builder.parse(source); ``` Error occurs: `org.xml.sax.SAXParseException; The element type "br" must be terminated by the matching end-tag` I don't want replace all `<br>` by `<br></br>`, any solution or advice?

Original source