{"action":"created","issue":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/195","repository_url":"https://api.github.com/repos/ckeditor/ckeditor5-core","labels_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/195/comments","events_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/195/events","html_url":"https://github.com/ckeditor/ckeditor5-core/issues/195","id":132645770,"number":195,"title":"Move TemplateDefinition#text to #children","user":{"login":"oleq","id":1099479,"avatar_url":"https://avatars.githubusercontent.com/u/1099479?v=3","gravatar_id":"","url":"https://api.github.com/users/oleq","html_url":"https://github.com/oleq","followers_url":"https://api.github.com/users/oleq/followers","following_url":"https://api.github.com/users/oleq/following{/other_user}","gists_url":"https://api.github.com/users/oleq/gists{/gist_id}","starred_url":"https://api.github.com/users/oleq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleq/subscriptions","organizations_url":"https://api.github.com/users/oleq/orgs","repos_url":"https://api.github.com/users/oleq/repos","events_url":"https://api.github.com/users/oleq/events{/privacy}","received_events_url":"https://api.github.com/users/oleq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/labels/module:core","name":"module:core","color":"fef2c0"},{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/labels/module:ui","name":"module:ui","color":"fef2c0"},{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/labels/type:enhancement","name":"type:enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/labels/type:question","name":"type:question","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"oleq","id":1099479,"avatar_url":"https://avatars.githubusercontent.com/u/1099479?v=3","gravatar_id":"","url":"https://api.github.com/users/oleq","html_url":"https://github.com/oleq","followers_url":"https://api.github.com/users/oleq/followers","following_url":"https://api.github.com/users/oleq/following{/other_user}","gists_url":"https://api.github.com/users/oleq/gists{/gist_id}","starred_url":"https://api.github.com/users/oleq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleq/subscriptions","organizations_url":"https://api.github.com/users/oleq/orgs","repos_url":"https://api.github.com/users/oleq/repos","events_url":"https://api.github.com/users/oleq/events{/privacy}","received_events_url":"https://api.github.com/users/oleq/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-02-10T09:22:19Z","updated_at":"2016-02-10T11:59:53Z","closed_at":null,"body":"There's a lot of confusion because of `text` property in `TemplateDefinition`:\r\n\r\n```js\r\n{\r\n  tag: 'p',\r\n  children: [ { /* child1 */ }, { /* child2 */ }, ... ],\r\n  text: 'foo'\r\n}\r\n```\r\n\r\nHow `foo` should render? `<p>foo[child1][child2]</p>`, `<p>[child1]foo[child2]</p>`, `<p>[child1][child2]foo</p>`, `<p>[child1][child2]</p>`, `<p>foo</p>`? It's all ambiguous. \r\n\r\nAnd there's a problem with #188. How to apply a template to existing DOM tree? What to do with `text` property? Re–render it? What to do with existing children then? etc.\r\n\r\n```js\r\n{\r\n  tag: 'p',\r\n  children: [ { /* child1 */ }, { /* child2 */ }, { text: 'foo' } ],\r\n}\r\n```\r\n\r\nmakes more sense. It gives a meaningful position to the text, being a child of parent.\r\n\r\n----\r\n\r\nI know that it complicates things a bit because the following\r\n\r\n```js\r\n{\r\n  tag: 'p',\r\n  text: 'foo'\r\n}\r\n```\r\n\r\nwill be\r\n\r\n```js\r\n{\r\n  tag: 'p',\r\n  children: [ { text: 'foo' } ]\r\n}\r\n```\r\n\r\nbut it's still worth it, IMO."},"comment":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/comments/182335330","html_url":"https://github.com/ckeditor/ckeditor5-core/issues/195#issuecomment-182335330","issue_url":"https://api.github.com/repos/ckeditor/ckeditor5-core/issues/195","id":182335330,"user":{"login":"oleq","id":1099479,"avatar_url":"https://avatars.githubusercontent.com/u/1099479?v=3","gravatar_id":"","url":"https://api.github.com/users/oleq","html_url":"https://github.com/oleq","followers_url":"https://api.github.com/users/oleq/followers","following_url":"https://api.github.com/users/oleq/following{/other_user}","gists_url":"https://api.github.com/users/oleq/gists{/gist_id}","starred_url":"https://api.github.com/users/oleq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleq/subscriptions","organizations_url":"https://api.github.com/users/oleq/orgs","repos_url":"https://api.github.com/users/oleq/repos","events_url":"https://api.github.com/users/oleq/events{/privacy}","received_events_url":"https://api.github.com/users/oleq/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T11:59:53Z","updated_at":"2016-02-10T11:59:53Z","body":"Shorter version:\r\n\r\n```js\r\n{\r\n  tag: 'p',\r\n  children: [ 'foo', ... ]\r\n}\r\n```\r\n\r\nwith binding:\r\n\r\n```js\r\n{\r\n  tag: 'p',\r\n  children: [ { text: bind( ... ) }, ... ]\r\n}\r\n```\r\n"}}