RtfPipe icon indicating copy to clipboard operation
RtfPipe copied to clipboard

Parser: Newline whitespace characters are not ignored.

Open ChunbleBee opened this issue 2 years ago • 2 comments

New-line whitespace characters are supposed to be ignored from processing, unless they are added as control words. \n and \r is treated as a TextToken.

That is to say:

{
\rtf1

this is new text\par

}

Is parsed differently than:

{\rtf1 this is new text\par}

When the results should be equivalent.

ChunbleBee avatar Jan 24 '24 19:01 ChunbleBee

For reference, RTF Spec, Pg. 145:

A carriage return (character value 13) or line feed (character value 10) is treated as a \par
control if the character is preceded by a backslash. You must include the backslash; otherwise,
RTF ignores the control word. (You may also want to insert a carriage-return/line feed pair
without backslashes at least every 255 characters for better text transmission over
communication lines.)

ChunbleBee avatar Jan 24 '24 19:01 ChunbleBee

More information: Any text after a newline is considered a plain text until a control symbol is encountered.

ChunbleBee avatar Jan 24 '24 21:01 ChunbleBee