Skip to content

Doesn't handle text with unclosed brackets #20

Description

@james-bw

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 + "]");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions