{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/draft-js/issues/166","repository_url":"https://api.github.com/repos/facebook/draft-js","labels_url":"https://api.github.com/repos/facebook/draft-js/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/facebook/draft-js/issues/166/comments","events_url":"https://api.github.com/repos/facebook/draft-js/issues/166/events","html_url":"https://github.com/facebook/draft-js/issues/166","id":138935579,"number":166,"title":"Ability to select what inline styles to retain/strip in paste","user":{"login":"remko","id":12300,"avatar_url":"https://avatars.githubusercontent.com/u/12300?v=3","gravatar_id":"","url":"https://api.github.com/users/remko","html_url":"https://github.com/remko","followers_url":"https://api.github.com/users/remko/followers","following_url":"https://api.github.com/users/remko/following{/other_user}","gists_url":"https://api.github.com/users/remko/gists{/gist_id}","starred_url":"https://api.github.com/users/remko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remko/subscriptions","organizations_url":"https://api.github.com/users/remko/orgs","repos_url":"https://api.github.com/users/remko/repos","events_url":"https://api.github.com/users/remko/events{/privacy}","received_events_url":"https://api.github.com/users/remko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-07T09:51:48Z","updated_at":"2016-03-07T17:21:20Z","closed_at":null,"body":"Right now, you can choose whether your editor accepts rich text or not in paste using `stripPastedStyles`. It's not always all-or-nothing, though: in case your editor only supports a subset of the supported styles, pasting can insert things the user can't remove anymore. For example, the Facebook Notes editor doesn't support underline or strikethrough, and yet you can paste underlined/striked text, and you can't get rid of that style anymore without deleting the entire piece of text.\r\n\r\nIt would be handy to have a prop on the editor component to specify which inline styles should be retained on paste. (opt-in)"},"comment":{"url":"https://api.github.com/repos/facebook/draft-js/issues/comments/193356808","html_url":"https://github.com/facebook/draft-js/issues/166#issuecomment-193356808","issue_url":"https://api.github.com/repos/facebook/draft-js/issues/166","id":193356808,"user":{"login":"hellendag","id":2823852,"avatar_url":"https://avatars.githubusercontent.com/u/2823852?v=3","gravatar_id":"","url":"https://api.github.com/users/hellendag","html_url":"https://github.com/hellendag","followers_url":"https://api.github.com/users/hellendag/followers","following_url":"https://api.github.com/users/hellendag/following{/other_user}","gists_url":"https://api.github.com/users/hellendag/gists{/gist_id}","starred_url":"https://api.github.com/users/hellendag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellendag/subscriptions","organizations_url":"https://api.github.com/users/hellendag/orgs","repos_url":"https://api.github.com/users/hellendag/repos","events_url":"https://api.github.com/users/hellendag/events{/privacy}","received_events_url":"https://api.github.com/users/hellendag/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T17:21:20Z","updated_at":"2016-03-07T17:21:20Z","body":"You're right, we could handle this better. One idea would be to replace `stripPastedStyles` with a configuration object, and pass that through to the paste processor:\r\n\r\n```javascript\r\n// Flow type\r\ntype DraftPasteSupport = {\r\n  inlineStyles: List<string>,\r\n  blockTypes: List<string>,\r\n  links: boolean,\r\n};\r\n\r\n// in DraftEditorProps\r\npasteSupport: DraftPasteSupport,\r\n\r\n// defaultProps\r\npasteSupport: {\r\n  inlineStyles: List('BOLD', 'ITALIC', 'UNDERLINE', ...),\r\n  blockTypes: List('header-one', ...),\r\n  links: true,\r\n}\r\n```\r\n\r\nThen the equivalent of `stripPastedStyles={true}` would be:\r\n\r\n```javascript\r\nconst PLAINTEXT_PASTE = {\r\n  inlineStyles: List(),\r\n  blockTypes: List(),\r\n  links: false,\r\n};\r\n```\r\n\r\nWhat do you think?\r\n\r\ncc @CLowbrow "}}