Giter Site home page Giter Site logo

lvu / rtf2html Goto Github PK

View Code? Open in Web Editor NEW
62.0 4.0 21.0 134 KB

RTF to HTML converter for use both with your applications and as a standalone tool. Small and fast. Processes tables better than any other tool I've seen.

License: GNU Lesser General Public License v2.1

C++ 46.39% C 2.36% Shell 32.91% Makefile 15.45% M4 2.90%

rtf2html's Introduction

1.  Overview

    This is RTF to HTML converter version 0.1.0.
    Copyright (C) 2003 Valentin Lavrinenko, [email protected]
    
    Its primary purpose is using by developers to add rtf to html 
    converting functionality to their projects, although, end users 
    can also find it useful.

    The main effort was made on processing the tables correctly, and it
    seems successful - all other programs I've seen do tables processing
    much worse. Moreover, at the moment, I haven't seen any file that
    displays correctly in MS Word, but crashes this program.
    
    For further information, go to
    http://www.sourceforge.net/projects/rtf2html


2.  Copying

    Distributed under LGPL license - see COPYING.LESSER, it must be 
    in the archive.


3.  Compiling

    - Under UNIX:
      Just ./configure && make && make install. The program seems
      to work much (about 2 times) faster when compiled with STLPort
      STL implementation than with the GNU one. So, you may use
      --with-stlport configure option if you have it installed.

    - Under MS Windows:
      Use MSYS/MinGW, use it the same way as in UNIX.
      No makefiles for other Win compilers are included yet, so,
      write it yourself, if you want - it isn't that hard.
      BCC is no longer supported!

4.  Installation

    No binary distribution for Unix/Linux is provided - just
    compile the program from source (see above). You can, however,
    download a binary package for MS Windows from the project page,
    http://www.sf.net/projects/rtf2html.

5.  Usage

    5.1 Command-line options

        rtf2html -v|--version

	prints the current version.

	rtf2html -h|--help

	prints the help.
    
        rtf2html [<rtf file> [<html file>]].
    
        Converts the file. If either of files is not specified, 
	the corresponding std descriptor (stdin or stdout) is used.

    5.2 Supported features

        This version supports the following:
        - Character formatting: bold, italic, underline, sub- and superscripts.
         NOTE: underlining is displayed only as solid.
        - Paragraph formatting: horizontal alignment, indentation, margins.
        - Table formatting: arbitrary cell spans, cell sizings, borders, 
          vertical alignment in cells.
         NOTE: borders are displayed correctly only under IE 5+ and only 
               as solid.
        - Page formatting: page width, left margin.
        - Hexadecimal character codes (Cyrillic letters would come out in 
          win1251)
        - Font faces and sizes.
        - Foreground and background colors, highlighting.
    
    5.3 Unsupported features

        This version DOES NOT support the following:
	- Character sets.
	- Hyperlinks.
        - Images.
        - Different stuff like macros, embedded OLE objects, etc.


6.  Compiling notes.

    The source was compiled with 
    - gcc 3.3 under ALT Linux Master 2.4 on i386
    - gcc 3.4.2 (MinGW) under Win2k
    

rtf2html's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rtf2html's Issues

Using on Windows

How to use rtf2html on windows? I downloaded the file .EXE but isn't working for me

tabs and blank space

If there are tabs or spaces at the beginning of a line, they are removed.
The same if they are between words.

parsing \uXXX? characters

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

It doesn't properly treat \uXXX? characters. In my RTF files at least, the XXX are decimal representations of a unicode one.

workaround

The tool is properly treating\'XXencoded characters (it ignores the codepage, but in my case it's okay since I'm expecting it to always be Windows 1253/ISO 8859-7(greek)).
I'm preprocessing the file, replacing all the \uXXX? characters with their Windows 1253 equivalent. Of course some times (particularly when the characters encoded are not in the range of Windows 1253) it won't map properly, but for my scenario it's acceptable and rare.

Some crashes occur when fuzzing rtf2html.

Version

hjsz@hjsz:~/rtf2html$ ./rtf2html -v
rtf2html version 0.2.0

Command

./rtf2html

Crash output

Crash1: heap-buffer-overflow

=================================================================
==3467450==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x63000000f401 at pc 0x0000004e744e bp 0x7ffc3c277010 sp 0x7ffc3c277008
READ of size 1 at 0x63000000f401 thread T0
#0 0x4e744d in void skip_group<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >&) /home/hjsz/rtf2html/./rtf_tools.h:27:15
#1 0x4db43c in main /home/hjsz/rtf2html/rtf2html.cpp:158:16
#2 0x7f7e99536082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#3 0x41da0d in _start (/home/hjsz/rtf2html/rtf2html+0x41da0d)
0x63000000f401 is located 0 bytes to the right of 61441-byte region [0x630000000400,0x63000000f401)
allocated by thread T0 here:
#0 0x4c58bd in operator new(unsigned long) (/home/hjsz/rtf2html/rtf2html+0x4c58bd)
#1 0x7f7e999e635d in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) (/lib/x86_64-linux-gnu/libstdc++.so.6+0x14335d)
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/hjsz/rtf2html/./rtf_tools.h:27:15 in void skip_group<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >&)
Shadow bytes around the buggy address:
0x0c607fff9e30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c607fff9e40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c607fff9e50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c607fff9e60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c607fff9e70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c607fff9e80:[01]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c607fff9e90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c607fff9ea0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c607fff9eb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c607fff9ec0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c607fff9ed0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==3467450==ABORTING

Crash2 : SEGV on unknown address

=================================================================
AddressSanitizer:DEADLYSIGNAL
==3472093==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x0000004d2be7 bp 0x7ffcfb04e1d0 sp 0x7ffcfb04d080 T0)
==3472093==The signal is caused by a READ memory access.
==3472093==Hint: this fault was caused by a dereference of a high value address (see register values below). Dissassemble the provided pc to learn which register was used.
#0 0x4d2be7 in formatting_options::operator=(formatting_options const&) /home/hjsz/rtf2html/./fmt_opts.h:96:19
#1 0x4db0f9 in main /home/hjsz/rtf2html/rtf2html.cpp:572:21
#2 0x7f2556f85082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#3 0x41da0d in _start (/home/hjsz/rtf2html/rtf2html+0x41da0d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/hjsz/rtf2html/./fmt_opts.h:96:19 in formatting_options::operator=(formatting_options const&)
==3472093==ABORTING

POC

POC.zip

Report of Information Security Laboratory of Ocean University of China @OUC_ISLOUC @OUC_Blue_Whale

Image support

Can you please add Image support? This project would be perfect for what I need to use it for then.

Many undefined index vars

In windows cmd

rtf2htm sample.rtf sample.html

...
Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 60

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 60
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 80

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 80
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 60

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 60
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 80

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 80
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 60

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 60
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 80

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 80
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133

Notice: Undefined index: FOOTNOTE in E:...\rtf2htm\htmlparser.php on line 133
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159
PHP Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

Notice: Undefined index: SUP in E:...\rtf2htm\htmlparser.php on line 159

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.