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

Handle pasted content #495

Closed
wants to merge 1 commit into from
Closed

Handle pasted content #495

wants to merge 1 commit into from

Conversation

ellatrix
Copy link
Member

  • adds TinyMCE's paste plugin.

@aduth
Copy link
Member

aduth commented Apr 24, 2017

Is there some context for this that you can share?

@mtias mtias added Framework Issues related to broader framework topics, especially as it relates to javascript [Status] In Progress Tracking issues with work in progress labels May 3, 2017
@ellatrix ellatrix changed the title First try at adding a filter for external paste Clean up pasted content May 22, 2017
@ellatrix ellatrix added this to the May Week 4: Beta milestone May 22, 2017
@ellatrix ellatrix self-assigned this May 22, 2017
@ellatrix
Copy link
Member Author

At the moment this is more of a proof of concept.

  • The plugin strips unwanted attributes id, style and class from externally pasted content.
  • If the pasted content is inline, it will let the content be pasted in the block at the caret position.
  • If the pasted content is one block or more, it will parse the content and insert it after the block.

To do's:

  • Parser does not recognise blocks without delimiters, so at the moment pasted block content will be dumped in a freeform block. Cc @nylen.
  • Block content is inserted after the selected block rather than at the caret. Ideally the block should be split if possible and the posted content be inserted in between.

Apart from that I think this is a good improvement for paste...

@ellatrix
Copy link
Member Author

Redoing this a bit since the single paragraph approach was merged. This would allow us to do the following:

  • If the pasted content is inline, insert it at caret position. In other words, don't do anything special.
  • If the pasted content has blocks or block level content, split the text block at the caret, parse the content, and insert it between the split content.

@ellatrix ellatrix changed the title Clean up pasted content Handle pasted content Jun 20, 2017
@ellatrix
Copy link
Member Author

Partly merged, I'll split the rest in smaller PRs.

@ellatrix ellatrix closed this Jun 21, 2017
@ellatrix ellatrix deleted the add/paste-filters branch June 21, 2017 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants