{"action":"created","issue":{"url":"https://api.github.com/repos/torchbox/wagtail/issues/387","labels_url":"https://api.github.com/repos/torchbox/wagtail/issues/387/labels{/name}","comments_url":"https://api.github.com/repos/torchbox/wagtail/issues/387/comments","events_url":"https://api.github.com/repos/torchbox/wagtail/issues/387/events","html_url":"https://github.com/torchbox/wagtail/issues/387","id":36711113,"number":387,"title":"from wordpress to wagtail","user":{"login":"foxmask","id":208212,"avatar_url":"https://avatars.githubusercontent.com/u/208212?v=3","gravatar_id":"","url":"https://api.github.com/users/foxmask","html_url":"https://github.com/foxmask","followers_url":"https://api.github.com/users/foxmask/followers","following_url":"https://api.github.com/users/foxmask/following{/other_user}","gists_url":"https://api.github.com/users/foxmask/gists{/gist_id}","starred_url":"https://api.github.com/users/foxmask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foxmask/subscriptions","organizations_url":"https://api.github.com/users/foxmask/orgs","repos_url":"https://api.github.com/users/foxmask/repos","events_url":"https://api.github.com/users/foxmask/events{/privacy}","received_events_url":"https://api.github.com/users/foxmask/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/torchbox/wagtail/labels/Enhancement","name":"Enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/torchbox/wagtail/labels/Ready%20to%20develop!","name":"Ready to develop!","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-06-27T23:14:44Z","updated_at":"2015-07-21T09:49:00Z","closed_at":null,"body":"Just a question ; is it planed to make a migration script that permits to migrate from wordpress ?"},"comment":{"url":"https://api.github.com/repos/torchbox/wagtail/issues/comments/123244420","html_url":"https://github.com/torchbox/wagtail/issues/387#issuecomment-123244420","issue_url":"https://api.github.com/repos/torchbox/wagtail/issues/387","id":123244420,"user":{"login":"gasman","id":85097,"avatar_url":"https://avatars.githubusercontent.com/u/85097?v=3","gravatar_id":"","url":"https://api.github.com/users/gasman","html_url":"https://github.com/gasman","followers_url":"https://api.github.com/users/gasman/followers","following_url":"https://api.github.com/users/gasman/following{/other_user}","gists_url":"https://api.github.com/users/gasman/gists{/gist_id}","starred_url":"https://api.github.com/users/gasman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasman/subscriptions","organizations_url":"https://api.github.com/users/gasman/orgs","repos_url":"https://api.github.com/users/gasman/repos","events_url":"https://api.github.com/users/gasman/events{/privacy}","received_events_url":"https://api.github.com/users/gasman/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T09:49:00Z","updated_at":"2015-07-21T09:49:00Z","body":"@iraycd I suppose it depends how clever you want it to be...\r\n\r\nWordpress allows you to use any HTML, without restrictions, so the most appropriate existing block type would be `RawHTMLBlock`. However, that's not a perfect fit, since Wordpress evidently performs some processing on the text (e.g. converting line breaks to `<p>` tags - maybe there's more that I'm not aware of). A neater solution would be to create a new block type (`WordpressHTMLBlock`?) that translates between the 'pseudo-HTML' source code seen in the backend and the real HTML rendered on the front-end, using a similar mechanism to `RichTextBlock`:\r\n\r\nhttps://github.com/torchbox/wagtail/blob/v1.0/wagtail/wagtailcore/blocks/field_block.py#L232-269\r\nhttps://github.com/torchbox/wagtail/blob/v1.0/wagtail/wagtailcore/rich_text.py#L179-191\r\n\r\nThe best option of all would be for your plugin to parse the HTML from Wordpress and split it into multiple StreamField blocks (e.g. `<p>first para</p> <img src=\"...\"> <p>second para</p>` would be converted into a RichTextBlock, ImageChooserBlock and RichTextBlock) - this way, you're taking advantage of Wagtail's capabilities and adding the structure that Wordpress doesn't provide by itself. But that's probably a bit too ambitious for a first version!"}}