erdomke / RtfPipe

Library for processing rich-text format (RTF) streams
MIT License
120 stars 43 forks source link

Lists aren't converted correctly #53

Closed tipa closed 3 years ago

tipa commented 3 years ago

I have a RTF file as follows:

{\rtf1\fbidis\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Segoe UI;}{\f1\fnil Segoe UI;}{\f2\fnil\fcharset2 Symbol;}}
{\colortbl ;\red255\green255\blue255;}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1 
\pard{\pntext\f2\'B7\tab}{\*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb\'B7}}\tx720\cf1\f0\fs23 A\par
{\pntext\f2\'B7\tab}B\par
{\pntext\f2\'B7\tab}C\par

\pard 
{\pntext\f1 1)\tab}{\*\pn\pnlvlbody\pnf1\pnindent0\pnstart1\pndec{\pntxta)}}
\tx720 D\f1\par
}

It renders like this: image

RtfPipe converts that to:

<div style="font-size:12pt;font-family:&quot;Segoe UI&quot;;">
   <ul style="color:#FFFFFF;font-size:11.5pt;margin:0 0 0 72px;padding-left:0;">
      <li>A</li>
      <li>B</li>
      <li>C</li>
      <li>D</li>
   </ul>
</div>

which renders like - as one ol instead of an ulwith 3 lielements and one olwith 1 li: image

erdomke commented 3 years ago

This should now be resolved after the latest release.