-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Extra data added when pasting from word. #869
Comments
ugh |
@cperryk @brijeshb42 Could you give us a Word file that we can use to reproduce the bug? |
Here's an example: Here's just a snippit of the comments I'm seeing pasted in to an empty paragraph:
|
I've seen HUGE metadata like this. fortunately it's allll wrapped in comment nodes.
works to cleanup after the fact. or you could do a customReplacements that will match |
In my jquery ways, I've used this:
Can't figure out how to recursively grab the comments, so I just have to count on them being first level children of |
Actually, looks like this setting in the paste settings works:
Full settings:
|
* First ugly draft Pasting works, second pasting fails. * Log, log everything * Revert change on dist file * Revert some unecessary code change * Fix jslint issues and errors thrown during tests * Get custom paste working for every paste * Get rid of the console logs from paste extension * paste-handling: remove some member variables from paste handler * paste-handling: re-enable default paste handling + remove keyboard timing * paste-handling: use clipboard helper for regular paste + remove hasContentType helper * paste-handling: revert demo * paste-handling: Refactor handlePasteBinPaste to look similar to handlePaste * paste-handling: refactor and reduce two paste handling paths * ignore .idea * Prevent Firefox NS_ERROR_FAILURE: on keyup In Firefox if the editable is a node without children, then NS_ERROR_FAILURE: error thrown for every keyup until it gets a child node. Issue: yabwe#994 * Update core.js * paste-handling: convert trimHTML into replacements * Reuse selectRange helper method in other places * paste-handling: extract methods that shouldn't be part of paste handler api * Convert spaces to %20 in links if linkValidation is true for the anchor extension * Added separate test verification if linkValidation is false * Used encodeURI instead of replacing strings to catch other unwanted characters * Updated documentation for linkValidation encoding update * Rename RELEASE-PROCESS.md * Add instructions for running tests on external fork PRs in saucelabs * Updated test - Made the diff between input and validUrl only spaces * Make correction to external fork steps * Fix anchor test failure due to cross-browser issues * paste-handling: Add first test for paste-bin * paste-handling: cleanup pasteBin and fix defaultPrevented check * paste-handling: Add some more core tests for keyboard paste * paste-handling: Add tests to fully cover new functionality * Fix IE bugs * 5.15.1 * make event functions chainable * allow multiple targets in attachDOMEvent and detachDOMEvent * update docs * Re-organize content.spec.js a bit * Add Test and comment for fix for yabwe#994 * Fix yabwe#1047 - Add 'positionedToolbar' custom event (yabwe#1050) * Add failing test to reproduce yabwe#1047 * Fix yabwe#1047 - introduce positionedToolbar custom event * Add tests for positionedToolbar custom event * Add positionedToolbar to events documentation * Reference bug number in anchor-preview test * Fix typo in positionedToolbar event documentation * 5.16.0 * replace break-all with break-word * 5.16.1 * add issue and PR templates * add jsbin and codepen to example link * fix typo * Fix yabwe#942 Add core checkContentChanged method and use it for button example * Add tests for covering checkContentChanged * Almost final attempt * Update documentation for addElements and removeElements * Standardize usage of array operation helpers for dyn-add-elements * Get rid of reRunSetupListener and refactored setupListener's "editableInput" case. Also removed unnecessary functions in core and moved guid to utils * Add textarea tests for addElements * Convert elements into array for addElements and removeElements * Refactor core internal helpers to not require 'this' references * Add tests to cover destroy/setup bug with dynamic added/removed elements * Support selector and nodelist for addElements + removeElements * Don't worry about setup/destroy for add/removeElements just yet * Add tests for calling removeElements with textareas * Make sure textareas are cleaned up correctly in removeElements * Add more add/remove elements examples to README * Add more add/remove elements tests, including event handlers * Add test for dynamically adding disable-return element * Extract initElement helper from initElements * Move textarea initializing into initElement * Move attaching existing events to elements into initElement * Have setup use addElements to share common code path * Rename events.attachAllEvents for consistency * Remove unneeded addElement method * execActionInternal should pass opt to document.execCommand if action not match internal action * Add test to verify fix for yabwe#869 * Add regex to paste to remove supportLists comment from Word * 5.17.0 * Fix null pointer during the cleanupElement event I ran into an issue that after manually adding elements to the editor (through addElements), and later deleting them again there (through removeElements) was a TypeError being thrown. It appears that contentCache is not set when only using dynamically added elements, thus while removing that element it will run into an error resulting the element not being removed properly. This checks if contentCache is set. * Update events.js * Update events.js * Update events.js * refactor MediumEditor.execAction to use opts.value as an argument pass through document.execCommand * Fix failures from new tests in IE & Edge * Deprecate .url, .size, and .name for execAction * Update API.md with more details about arguments * Add test to ensure bc for .url option for createLink * 5.18.0 * Add test to ensure editablePaste is triggered on keyboard paste * Add test to verify editablePaste is triggered on normal paste * Ensure editablePaste is triggered on keyboard paste * Ensure editablePaste always gets consistent data when called * Allow preview to be shown on empty links * 5.19.1 * Update tests to ensure unique ids when timestamp is same * Remove broken code for adding index to textarea-div id * Add the id of the editor instance to each element * Add tests for removing element attr on destroy * Add getEditorFromElement static helper * Add getEditorByElement and version to API documentation * Add getContent helper method * Add documentation for getContent method * documented the showOnEmptyLink option * Add resetContent helper method * Add documentation for resetContent * Respect form.reset for textareas * Fix bug in resetContent logic * Add grunt to local packages and create NPM build script * Add getInteractionElements to extension contract for preventing blur * Add test failure for yabwe#1105 * Fix yabwe#1105 * Add documentation for getInteractionElements for extensions * 5.20.0 * Fix test failure in Chrome 51 * Use class selector instead attribute selector * Update tests to expect new medium-editor-element class * Fix yabwe#234 - Cursor rendering incorrectly in firefox * Improve documentation for toolbar.relativeContainer option * Work around firefox test case failing in saucelabs only * 5.20.2 * Add addElement custom event when elements are added * Add documentation for addElement custom event * Fix bug in paste handler introduced by 8bd8f8f * Expose removeElement custom event * Ensure placeholder extension initializes dynamically added elements * Ensure placeholder extensions cleans up removed elements * Undo changes from 8bd8f8f * yabwe#1123 Fixes issue with electron environment * 1123, adds strict check for object * yabwe#1127 | Placeholder is visible when only empty table is in Editor. * yabwe#1127 | Add Test cases * 5.21.0
A whole mess of html comments get added in a separate
p
tag when I try to paste contents from a word document.The text was updated successfully, but these errors were encountered: