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

fix for TIKA-3089 contributed by pvanderweerd #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ private void handleText(Reader reader, Charset charset,

private static void handleText(Reader reader, XHTMLContentHandler xhtml)
throws SAXException, IOException {
xhtml.startElement("p");
xhtml.startElement("pre");
char[] buffer = new char[4096];
int n = reader.read(buffer);
while (n != -1) {
xhtml.characters(buffer, 0, n);
n = reader.read(buffer);
}
xhtml.endElement("p");
xhtml.endElement("pre");

}

Expand Down Expand Up @@ -306,7 +306,6 @@ private CSVParams getOverride(Metadata metadata) {

String delimiterString = mediaType.getParameters().get(DELIMITER);
if (delimiterString == null) {
return new CSVParams(mediaType, charset);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removal was unintentional. Apologies for not double checking the diff.
Shall I create a new merge request?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can revert it and commit the changes to your branch. It'd automatically show up in this PR.

}
if (STRING_TO_CHAR_DELIMITER_MAP.containsKey(delimiterString)) {
return new CSVParams(mediaType, charset, (char) STRING_TO_CHAR_DELIMITER_MAP.get(delimiterString));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ public void parse(
new XHTMLContentHandler(handler, metadata);
xhtml.startDocument();

xhtml.startElement("p");
xhtml.startElement("pre");
char[] buffer = new char[4096];
int n = reader.read(buffer);
while (n != -1) {
xhtml.characters(buffer, 0, n);
n = reader.read(buffer);
}
xhtml.endElement("p");
xhtml.endElement("pre");

xhtml.endDocument();
}
Expand Down