Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
While parsing some RTF files I'm finding that the RTF parser tags many text spans as bold even if they are not. I am attaching a sample RTF file that exhibits this behavior. When parsing the file the first line is correctly tagged as bold. However the second line (the phone number) which is not supposed to be bold is tagged as bold.
The following code demonstrates the problem.
InputStream inputStream = Thread.currentThread().getContextClassLoader() .getResourceAsStream("sample-rtf.rtf"); Parser parser = new RTFParser(); ContentHandler contentHandler = new ToXMLContentHandler(); Metadata metadata = new Metadata(); ParseContext context = new ParseContext(); parser.parse(inputStream, contentHandler, metadata, context); String xml = contentHandler.toString();