rtf2html icon indicating copy to clipboard operation
rtf2html copied to clipboard

superscript/subscript \super \sub .... \nosupersub

Open FotisK opened this issue 9 years ago • 0 comments

intro

disclaimer: I'm not opening these issues asking for some solution; actually I'm very grateful for the existence of rt2html because of all the thing I tried, it is the only one that really produces proper html output. These issues may be known, or not, but since I'm not able to correct these at the time I'm posting for posterity. Right now I'm just running the windows binary - one day I may find the time to read the code and see if there is something I can add even though I'm not very skilled programmer

so why am I opening these issues?

  1. to say thank you, because it's really proven helpful!
  2. to show some activity because at least for me issues/wiki entries indicate a piece of software that has been tested by other users
  3. to point out a few quirks and (some patchy solutions I've done)

Issue description

In one of my documents, I found an instance where there was a superscript. While rtf2html didn't see it and create the html for it, it didn't see the closing tag/directive \nosupersub so the rest of the paragraph was also being formatted as a superscript. I'm quoting the problematic part of the file

\cf0\lang1032 
\par \cf1\lang1033\b     Cystoscopy\b0 : (Achieved only with flexible cystoscope) showed 3 or more nut-sized tumors into the bladder "fundus" and a voluminous prostate gland.  \f1 (\f0 CT scan and an endoscopy CD have been handed to the patient\f1 )\cf0\lang1032\f0 
\par \cf1\lang1033 On January 9\super th \nosupersub (under regional anesthesia), we tried to remove the tumors from the bladder using a conventional resectoscope (Stortz).\cf0\lang1032 
\par \cf1\lang1033 Despite the effort, we didn't succeed in removing the tumors due to the fact that in our institution we didn't have resectoscopes specialized for such cases. A longer instrument was needed.\cf0\lang1032 
\par

Starting at the phrase January 9_th (under regional_ everything was made into superscript and every single character was being placed in a nested inside the last characters span.

workaround

During preprocessing I encapsulated every \super XXX \nosupersub or \sub XXX \nosupersub inside an RTF group: Starting with { and ending } ie. {\super th \nosupersub} which forced rtf2html to remove the formatting at the expected place.

FotisK avatar Apr 21 '16 16:04 FotisK