• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / httpunit / 755

14 Feb 2026 07:14PM UTC coverage: 80.526%. Remained the same
755

push

github

hazendaz
[ci] Fix badge

3213 of 4105 branches covered (78.27%)

Branch coverage included in aggregate %.

8245 of 10124 relevant lines covered (81.44%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/src/main/java/com/meterware/httpunit/parsing/NekoHTMLParser.java
1
/*
2
 * SPDX-License-Identifier: MIT
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2000-2026 Russell Gold
6
 * Copyright 2021-2000 hazendaz
7
 */
8
package com.meterware.httpunit.parsing;
9

10
import java.io.IOException;
11
import java.io.StringReader;
12
import java.net.URL;
13

14
import org.w3c.dom.Document;
15
import org.w3c.dom.html.HTMLDocument;
16
import org.xml.sax.InputSource;
17
import org.xml.sax.SAXException;
18

19
/**
20
 * The Class NekoHTMLParser.
21
 */
22
class NekoHTMLParser implements HTMLParser {
1✔
23

24
    /**
25
     * parse the given URL with the given pageText using the given document adapter
26
     *
27
     * @param pageURL
28
     * @param pageText
29
     * @param adapter
30
     */
31
    @Override
32
    public void parse(URL pageURL, String pageText, DocumentAdapter adapter) throws IOException, SAXException {
33
        try {
34
            NekoDOMParser parser = NekoDOMParser.newParser(adapter, pageURL);
1✔
35
            parser.parse(new InputSource(new StringReader(pageText)));
1✔
36
            Document doc = parser.getDocument();
1✔
37
            adapter.setDocument((HTMLDocument) doc);
1✔
38
        } catch (NekoDOMParser.ScriptException e) {
×
39
            throw e.getException();
×
40
        }
1✔
41
    }
1✔
42

43
    @Override
44
    public String getCleanedText(String string) {
45
        return string == null ? "" : string.replace(NBSP, ' ');
1!
46
    }
47

48
    @Override
49
    public boolean supportsPreserveTagCase() {
50
        return false;
×
51
    }
52

53
    @Override
54
    public boolean supportsForceTagCase() {
55
        return false;
×
56
    }
57

58
    @Override
59
    public boolean supportsReturnHTMLDocument() {
60
        return true;
1✔
61
    }
62

63
    @Override
64
    public boolean supportsParserWarnings() {
65
        return true;
×
66
    }
67

68
    /** The Constant NBSP. */
69
    private static final char NBSP = (char) 160; // non-breaking space, defined by nekoHTML
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc