Copy and pasting fragments injecting NULL characters in applet
Posted: Tue Dec 04, 2012 4:12 pm
I've come across an issue whereby the Author is selecting a mixture of text and the full element and pasting it into a new paragraph. An example of the selection is
When the Author then pastes this into another paragraph it is displayed in the Author applet as
.
We are using a DocumentFilter to make sure the paste doesn't have more than 2000 characters but if it doesn't we are passing it on to the AuthorDocumentFilterBypass to insert the fragment.
Do you have any suggestions as to why the paste is failing?
Code: Select all
Paragraph text <citation>Enter citation here</citation>
Code: Select all
<citation/>aragraph text Enter citation here
We are using a DocumentFilter to make sure the paste doesn't have more than 2000 characters but if it doesn't we are passing it on to the AuthorDocumentFilterBypass to insert the fragment.
Code: Select all
if (paraText.length() + size <= CHARACTER_LENGTH) {
bypass.insertFragment(offset, fragment);
} else {
access.getWorkspaceAccess().showInformationMessage("Unable to insert fragment into para because the fragment would breach " + CHARACTER_LENGTH + " character threshold.");
}