bbottema / rtf-to-html

RTF to HTML conversion done right
8 stars 5 forks source link

Handle \line as newline in RTF2HTMLConverterRFCCompliant #7

Open basinilya opened 3 years ago

basinilya commented 3 years ago

Within an HTML <pre> block Outlook does not use \par, but instead it uses \line not enclosed within htmlrtf pair. This newline should be preserved by RTF2HTMLConverterRFCCompliant. Example: outlook-message-parser attachments.msg

{\rtf1\ansi\ansicpg1252\fromhtml1 \fbidis \deff0
{\*\htmltag128 <pre>}
\htmlrtf {
\pard\plain\f1\fs20 \htmlrtf0 \htmlrtf {
\htmlrtf0 \htmlrtf {\cf4 \fs20 \f5 \htmlrtf0 Received: from ABMAIL13.ci.atlantic-beach.fl.us (10.10.10.21) by\line
 ABMAIL13.ci.atlantic-beach.fl.us (10.10.10.21) with Microsoft SMTP Server\line
 (TLS) id 15.0.1076.9; Mon, 11 Apr 2016 09:08:47 -0400\line
Received:}}\htmlrtf0
{\*\htmltag136 </pre>}\htmlrtf }\htmlrtf0 
}*\

Expected:

<pre>Received: from ABMAIL13.ci.atlantic-beach.fl.us (10.10.10.21) by
 ABMAIL13.ci.atlantic-beach.fl.us (10.10.10.21) with Microsoft SMTP Server
 (TLS) id 15.0.1076.9; Mon, 11 Apr 2016 09:08:47 -0400
Received:</pre>

Actual:

<pre>Received: from ABMAIL13.ci.atlantic-beach.fl.us (10.10.10.21) by ABMAIL13.ci.atlantic-beach.fl.us (10.10.10.21) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Mon, 11 Apr 2016 09:08:47 -0400Received:</pre>