Skip to content

Commit a0c0a75

Browse files
sideshowbarkerhsivonen
authored andcommitted
Make io.Driver expose public dontSwallowBom()
This change makes nu.validator.htmlparser.io.Driver instances have a dontSwallowBom() method exposed. Otherwise, without this change, it’s not possible for users of io.Driver to preserve the BOM in input.
1 parent 9ffe6b9 commit a0c0a75

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/nu/validator/htmlparser/io/Driver.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class Driver implements EncodingDeclarationHandler {
5959
*/
6060
private RewindableInputStream rewindableInputStream;
6161

62-
private boolean swallowBom;
62+
private boolean swallowBom = true;
6363

6464
private Encoding characterEncoding;
6565

@@ -196,7 +196,6 @@ public void tokenize(InputSource is, int bufferSize)
196196
}
197197
tokenizer.start();
198198
confidence = Confidence.TENTATIVE;
199-
swallowBom = true;
200199
rewindableInputStream = null;
201200
tokenizer.initLocation(is.getPublicId(), is.getSystemId());
202201
this.reader = is.getCharacterStream();
@@ -284,7 +283,7 @@ public void tokenize(InputSource is, int bufferSize)
284283
}
285284
}
286285

287-
void dontSwallowBom() {
286+
public void dontSwallowBom() {
288287
swallowBom = false;
289288
}
290289

0 commit comments

Comments
 (0)