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

Fix crash if invalid character is inserted into the text. #578

Merged
merged 1 commit into from May 21, 2019

Conversation

kakaroto
Copy link
Contributor

@kakaroto kakaroto commented May 9, 2019

If an invalid character is inserted into the text, such as a "^L" (ASCII 0x0C)
when copy-pasting from a google document that has a page break in it, a crash
will happen as the character cannot be inserted into XML. This patch removes
those invalid characters from the text so the revisions.xml can be saved.

Fixes #562

If an invalid character is inserted into the text, such as a "^L" (ASCII 0x0C)
when copy-pasting from a google document that has a page break in it, a crash
will happen as the character cannot be inserted into XML. This patch removes
those invalid characters from the text so the revisions.xml can be saved.

Fixes olivierkes#562
@BlackXanthus
Copy link

Question: wouldn't it be better to convert the character to it's correct manuskirpt counterpart? Perhaps it's not a task for this particular action (as it's a bug-fix, it definately shouldn't crash), but perhaps it should honour the line-break in some way?

@kakaroto
Copy link
Contributor Author

As far as I could find, there is no line-break counterpart in manuskript. Also, the character remains in the text, it only gets removed from the XML file (revisions) so you'd only lose it if you restore previous revisions. Note also that this is how I got to reproduce this crash, but any other non-xml-acceptable character would cause the same issue unfortunately.

@gedakc
Copy link
Collaborator

gedakc commented May 21, 2019

Using the instructions from issue #562 I have confirmed the "crash on save" in kubuntu 16.04. With the patch applied the "crash on save" does not occur.

I believe that the patch is a good compromise because we never want Manuskript to crash, and the likelihood that someone needs to restore text containing an invalid XML character, such as Ctrl+L, is slim.

I will merge this PR with the develop branch.

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.

Crash on insertion of new page character
3 participants