posativ/acrylamid — pull request #190 by geekman (2013-11-27 17:32:00+00:00)
Title: Import task fixes

I'm trying to migrate my existing Wordpress blog and have encountered a few issues which I'm addressing here.

- Raw HTML such as the `` comment and `

` tags were not passed through in the Pandoc conversion process into the Markdown format. This is fixed by passing `--parse-raw` to pandoc, although I'm unsure if there'll be any side effects for other formats
- The `filter` header is *always* written out to the Markdown front matter for *all* imported entries. This causes the `markdown+codehilite+...` filter specified in global `conf.py` to be ignored. I would think it makes sense to **not** specify the `filter` for each entry since you would likely be converting it into a common format used by all entries anyway.
- The `draft` header is not written out to the front matter, causing the draft status to be lost.
- There's a bug that causes an Exception when `--keep-links` is specified during import. In some cases, the Wordpress permalink may be `http://blog.wordpress.com/?p=100` which causes a `None` to be assigned to the entry's permalink (since `m.path == '/'`). This in turn causes the Entry to **not** assign a permalink and hence retain `permalink = None` and `dirname(entry.permalink)[1:]` to throw an Exception. The correct fix in this case is to not assign `entry['permalink']` at all and let the Entry create a permalink based on the safeslug from the entry title.