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

Doesn't handle text with unclosed brackets #20

Open
james-bw opened this issue Nov 9, 2018 · 0 comments
Open

Doesn't handle text with unclosed brackets #20

james-bw opened this issue Nov 9, 2018 · 0 comments

Comments

@james-bw
Copy link

james-bw commented Nov 9, 2018

If I use this library to parse text that is either RTF or plain text, and the plain text uses curly braces that are not closed, then an java.lang.IllegalStateException: Unmatched brace exception is thrown.

String RTFText = "Some plan text with {  unclosed ] curly brace";
String PlainText = "";
try {
            InputStream inputStream = new ByteArrayInputStream(RTFText.getBytes("UTF-8")); 
            StringTextConverter converter = new StringTextConverter();
            converter.convert(new RtfStreamSource(inputStream));
            PlainText = converter.getText();
        } catch (IOException e) {
            System.out.println("Error: " + e.toString());
        }
System.out.println("Result: [" + PlainText + "]");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant