Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bullet numbers in list items have double numbers #14

Closed
bbottema opened this issue Jun 3, 2024 · 3 comments
Closed

Bullet numbers in list items have double numbers #14

bbottema opened this issue Jun 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@bbottema
Copy link
Owner

bbottema commented Jun 3, 2024

See bbottema/simple-java-mail#530
See nickrussler/email-to-pdf-converter#35
See bbottema/outlook-message-parser#64

This is an issue in the RTF parser, which is beyond me at the moment. I have no fix.

@bbottema bbottema added the help wanted Extra attention is needed label Jun 3, 2024
bbottema added a commit that referenced this issue Jun 3, 2024
@nickrussler
Copy link

To provide compatibility with existing RTF readers, all applications that can automatically format paragraphs with bullets or numbers will also emit the generated text as plain text in the \pntext group. This will allow existing RTF readers to capture the plain text and safely ignore the autonumber instructions. This group precedes all bulleted or numbered paragraphs, and will contain all the text and formatting that would be auto-generated. It should precede the '{'*\pn ... '}' destination, and it is the responsibility of RTF readers that understand the '{'*\pn ... '}' destination to ignore the \pntext group.
(https://www.biblioscape.com/rtf15_spec.htm)

reads to me that the {\pntext 2.\tab} in e.g.

{\*\htmltag64 <li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo1'>}\htmlrtf {{\*\pn\pnlvlbody\pndec\pnstart2\pnindent360{\pntxta .}}\htmlrtf0 \li360 \fi-360 {\pntext 2.\tab}Test2

{\*\htmltag244 <o:p>}

{\*\htmltag252 </o:p>}\htmlrtf\par}\htmlrtf0


{\*\htmltag72 </li>}

can be ignored / stripped under the condition that the reader (which is a browser due to the conversion) can render numbered lists. I am not sure if that is conditional on the ol html tag having set the type attribute or not.

bbottema added a commit that referenced this issue Jun 8, 2024
@bbottema
Copy link
Owner Author

bbottema commented Jun 8, 2024

Well that turned out to be an extremely simple fix. Thanks so much! Released in 1.1.1. I'll update outlook-msg-parser shortly.

@bbottema bbottema closed this as completed Jun 8, 2024
@bbottema bbottema added bug Something isn't working and removed help wanted Extra attention is needed labels Jun 8, 2024
@nickrussler
Copy link

Awesome! Thanks for the fix

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants