Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add a match for the combination of OpeningBracket and Pard in the parse_header method #12

Merged
merged 2 commits into from
Apr 14, 2024

Conversation

zyk-mjzs
Copy link
Contributor

html-to-rtf generated RTF can be previewed on Mac,but error with MalformedPainterStack

{\rtf1\ansi\deff0{\fonttbl {\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset2 Symbol;}}{\colortbl ;}{\pard \u21435  \sb70\par}}

I add a match for the combination of OpeningBracket and Pard in the parse_header method, and add a test named parse_opening_bracket_and_pard

@d0rianb
Copy link
Owner

d0rianb commented Apr 14, 2024

The issue is deeper than just for the \pard. To properly fix this, we should add a check for every "break" word that made the parser exit the header parsing (plain, pard, par, etc) to see if it's preceeded by an opening bracket (since it's allowed by the RTF specification.
Identifiying the end of the header is a problem that I have since the beginning of the project and I'm considering merging the parse_header method with the parse one.

@zyk-mjzs
Copy link
Contributor Author

我认为这样可行

The issue is deeper than just for the \pard. To properly fix this, we should add a check for every "break" word that made the parser exit the header parsing (plain, pard, par, etc) to see if it's preceeded by an opening bracket (since it's allowed by the RTF specification. Identifiying the end of the header is a problem that I have since the beginning of the project and I'm considering merging the parse_header method with the parse one.

I think this is feasible

@d0rianb
Copy link
Owner

d0rianb commented Apr 14, 2024

This is a temporary solution. I will merge it into master and continue working on the rework of parse_header on another branch.

@d0rianb d0rianb merged commit 7651b49 into d0rianb:master Apr 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants