Open jswiderski opened 6 years ago
The issue is probably with extractFromRtf
method in our PFW filter. Such objects in Word files are annotated with objdata
. Note also that some of such equations are exported as GIF images, which aren't currently supported.
Please resolve this problem.
From what I have checked in latest CKEditor 4.10.0, pasting formulas works quite nicely on Windows (it doesn't work on MAC) however there is a flaw. Formula is pasted as a plain text and as an image (base64 string).
Even below code returns text together with an image:
editor1.on( 'instanceReady', function( event ){
editor1.on( 'paste', function( evt ) {
console.log( evt.data.dataTransfer.$.getData( 'text/html' ) );
} );
} );
I'm having the same bug as jswiderski reported.
After analyzing the html code injected by CKEditor I added the following lines to the Paste from Word plugin default.js, In the cleanWord function after a = a.replace(/<![/g, "\x3c!--[").replace(/]>/g, "]--\x3e");
a = a.replace(/
This apparently fixed the bug.
@Migueeeeel Thank you very much. But I have to say that the code you pasted above is not same as photo shows, you forgot the backslash
thanks its work for me.
It changed to white backgroundColor after converted to base64 image. Is it possible to keep it original bgColor such as transparent.
this code not working
KEDITOR.cleanWord = CKEDITOR.pasteFilters.word = B.createFilter({ rules: [t.rules, q.rules], additionalTransforms: function (b) { CKEDITOR.plugins.clipboard.isCustomDataTypesSupported && (b = t.styles.inliner.inline(b).getBody().getHtml()); return b.replace(/<![/g, "\x3c!--[").replace(/]>/g, "]--\x3e"); }
It seems that our recent changes to Paste from Word changed the behaviour of pasting documents with equations. It works well in Safari (due to its unique way of handling images) and fails in other browsers (no images are pasted at all for document provided as an original example and equation is pasted as plain text for a newly created Word document).
Additionally there is some new format of equations in Word, which uses unsupported EMF image format (see #4290), which means that fully supporting equations is blocked until #4290 is resolved.
Feature request
Expected result
Math formulas created in MS Word are available as images. They should be pasted into CKEditor as base64 encoded images.
Actual result
At the moment these formulas are pasted as images with local paths what results in empty image.
Other details
Sample file with formulas: Math Paper-1.docx
Are you reporting a feature request or a bug?