• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • majix
  • Bugs

hyperlinks misparsed

RTF to XML Converter

Brought to you by: deannelson, stingeraj, troggan
  • Summary
  • Files
  • Reviews
  • Support
  • Mailing Lists
  • Tickets ▾
    • Feature Requests
    • Patches
    • Bugs
  • News
  • Discussion
  • Code
  • Cvs
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

  • v2.0

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#10 hyperlinks misparsed

open
nobody
RTF-Analyser (4)
5
2010-12-17
2010-12-17
Andrew Pimlott
No

I found some issues with parsing hyperlinks. Actually, I found them in an
older, hacked version of majix. But they seem to apply to the current
version of makix. However, I haven't inspected the current version as
closely, so forgive me if I get some things wrong. Also, I don't really
know anything about RTF--this is based on debugging problems in one file.

The code seems to expect hyperlinks to look something like this:

{\field {\*\fldinst ... HYPERLINK ...}
{\fldrslt ...}}

But in the file I have they look like:

{\field {\cf15 {\*\fldinst ...}}
{\cs5 {\fldrslt ...}}}

I don't know whether this is legal, but I have to handle it. (The file says
{\*\generator Microsoft Word 11.0.0000;}).

Let's see how this throws things off: In processField, we pass by {\cf15
(incrementing depth), and when we find \fldinst we call processFieldInstance
to do the rest. Here we've already lost, because processFieldInstance is
expected to read through the close of \fldinst and into \fldrslt; but it
doesn't know it has to go up a level past the \fldinst and close the \cf15.
What happens is getDataOfGroup reads through the close of \fldinst, and when
we get to getResultOfField, the first token we read is a } and we return
null.

In some cases, they look like:

{\field {\*\fldinst ...}
{\cs5 {\fldrslt ...}}}

In this case, we start getResultOfField at {\cs5 and skip past to {\fldrslt.
But then we return, without reading the close of \cs5 (because
getResultOfField does not track depth). That close will eventually be read
by parse, which will pop _theTextPropertiesStack. Note that
getResultOfField was not pushing, so that's a pop without a push.

I have a patch against the old version of majix I am using. I can supply a
patch for the current version, if you're interested. But since I might be
off base, I want to ask for guidance first.

Andrew

Discussion

  • Nobody/Anonymous

    Nobody/Anonymous - 2011-12-12

    http://unseddaweb.hotbox.ru

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2026 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise
Auth0 Logo