{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/11595","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11595/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11595/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11595/events","html_url":"https://github.com/WordPress/gutenberg/pull/11595","id":378357571,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MDgxOTg0","number":11595,"title":"Support Prepare RichText tree","user":{"login":"iseulde","id":4710635,"node_id":"MDQ6VXNlcjQ3MTA2MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/4710635?v=4","gravatar_id":"","url":"https://api.github.com/users/iseulde","html_url":"https://github.com/iseulde","followers_url":"https://api.github.com/users/iseulde/followers","following_url":"https://api.github.com/users/iseulde/following{/other_user}","gists_url":"https://api.github.com/users/iseulde/gists{/gist_id}","starred_url":"https://api.github.com/users/iseulde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iseulde/subscriptions","organizations_url":"https://api.github.com/users/iseulde/orgs","repos_url":"https://api.github.com/users/iseulde/repos","events_url":"https://api.github.com/users/iseulde/events{/privacy}","received_events_url":"https://api.github.com/users/iseulde/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/WordPress/gutenberg/milestones/72","html_url":"https://github.com/WordPress/gutenberg/milestone/72","labels_url":"https://api.github.com/repos/WordPress/gutenberg/milestones/72/labels","id":3784280,"node_id":"MDk6TWlsZXN0b25lMzc4NDI4MA==","number":72,"title":"4.3","description":"","creator":{"login":"gziolo","id":699132,"node_id":"MDQ6VXNlcjY5OTEzMg==","avatar_url":"https://avatars2.githubusercontent.com/u/699132?v=4","gravatar_id":"","url":"https://api.github.com/users/gziolo","html_url":"https://github.com/gziolo","followers_url":"https://api.github.com/users/gziolo/followers","following_url":"https://api.github.com/users/gziolo/following{/other_user}","gists_url":"https://api.github.com/users/gziolo/gists{/gist_id}","starred_url":"https://api.github.com/users/gziolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gziolo/subscriptions","organizations_url":"https://api.github.com/users/gziolo/orgs","repos_url":"https://api.github.com/users/gziolo/repos","events_url":"https://api.github.com/users/gziolo/events{/privacy}","received_events_url":"https://api.github.com/users/gziolo/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":110,"state":"open","created_at":"2018-10-31T07:05:04Z","updated_at":"2018-11-09T13:36:01Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-11-07T16:10:34Z","updated_at":"2018-11-09T13:47:56Z","closed_at":"2018-11-09T08:01:10Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/11595","html_url":"https://github.com/WordPress/gutenberg/pull/11595","diff_url":"https://github.com/WordPress/gutenberg/pull/11595.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/11595.patch"},"body":"## Description\r\n\r\nTo test: type \"Gutenberg\" in a RichText field. The word will be highlighted if it's the first occurrence, and if the \"Block\" sidebar is open. Now remove a letter, and highlighting will be gone. Add it back to add highlighting and go to the \"Document\" sidebar. Highlighting will be gone. It depends on the sidebar state.\r\n\r\nExample plugin code:\r\n\r\n```js\r\nwp.richText.registerFormatType( 'plugin/annotation', {\r\n\ttitle: 'invisible',\r\n\ttagName: 'mark',\r\n\tclassName: 'annotation',\r\n\t__experimentalGetPropsForEditableTreePreparation( select ) {\r\n\t\treturn {\r\n\t\t\tisEnabled: select( 'core/edit-post' ).getActiveGeneralSidebarName() === 'edit-post/block',\r\n\t\t};\r\n\t},\r\n\t__experimentalCreatePrepareEditableTree( props ) {\r\n\t\treturn ( formats, text ) => {\r\n\t\t\tif ( ! props.isEnabled ) {\r\n\t\t\t\treturn formats;\r\n\t\t\t}\r\n\r\n\t\t\tconst search = 'Gutenberg';\r\n\t\t\tconst index = text.indexOf( search );\r\n\r\n\t\t\tif ( index === -1 ) {\r\n\t\t\t\treturn formats;\r\n\t\t\t}\r\n\r\n\t\t\tconst start = index;\r\n\t\t\tconst end = index + search.length;\r\n\r\n\t\t\tconst newValue = wp.richText.applyFormat( { text, formats }, { type: 'plugin/annotation' }, start, end );\r\n\r\n\t\t\treturn newValue.formats;\r\n\t\t};\r\n\t},\r\n} );\r\n```\r\n\r\n## How has this been tested?\r\n<!-- Please describe in detail how you tested your changes. -->\r\n<!-- Include details of your testing environment, tests ran to see how -->\r\n<!-- your change affects other areas of the code, etc. -->\r\n\r\n## Screenshots <!-- if applicable -->\r\n\r\n## Types of changes\r\n<!-- What types of changes does your code introduce?  -->\r\n<!-- Bug fix (non-breaking change which fixes an issue) -->\r\n<!-- New feature (non-breaking change which adds functionality) -->\r\n<!-- Breaking change (fix or feature that would cause existing functionality to not work as expected) -->\r\n\r\n## Checklist:\r\n- [ ] My code is tested.\r\n- [ ] My code follows the WordPress code style. <!-- Check code: `npm run lint`, Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/ -->\r\n- [ ] My code follows the accessibility standards. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/accessibility-coding-standards/ -->\r\n- [ ] My code has proper inline documentation. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/ -->"},"comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments/437364288","html_url":"https://github.com/WordPress/gutenberg/pull/11595#issuecomment-437364288","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11595","id":437364288,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzM2NDI4OA==","user":{"login":"aduth","id":1779930,"node_id":"MDQ6VXNlcjE3Nzk5MzA=","avatar_url":"https://avatars1.githubusercontent.com/u/1779930?v=4","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T13:47:56Z","updated_at":"2018-11-09T13:47:56Z","author_association":"MEMBER","body":">Ideally this is followed up with some tests and a Christmas light investigation.\r\n\r\nBefore 4.3 I'd hope."}}
{"actor":{"display_login":"aduth"}}