Closed geekman closed 10 years ago
I'm not sure about the filter
header... especially when you do not reconverse HTML (probably because html2text fails and pandoc is hard to install due to Haskell/GHC).
Merged with a note to include -a "filter: html"
when importing without reconversion.
I'm converting the HTML in Wordpress to Markdown. The problem is, having filter: markdown
in every post overrides the filter settings in conf.py, which has +codehilite+...
. I was spending quite a bit of time debugging this issue, wondering why my code wasn't getting highlighted.
I'm trying to migrate my existing Wordpress blog and have encountered a few issues which I'm addressing here.
<!--more-->
comment and<table>
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 formatsfilter
header is always written out to the Markdown front matter for all imported entries. This causes themarkdown+codehilite+...
filter specified in globalconf.py
to be ignored. I would think it makes sense to not specify thefilter
for each entry since you would likely be converting it into a common format used by all entries anyway.draft
header is not written out to the front matter, causing the draft status to be lost.--keep-links
is specified during import. In some cases, the Wordpress permalink may behttp://blog.wordpress.com/?p=100
which causes aNone
to be assigned to the entry's permalink (sincem.path == '/'
). This in turn causes the Entry to not assign a permalink and hence retainpermalink = None
anddirname(entry.permalink)[1:]
to throw an Exception. The correct fix in this case is to not assignentry['permalink']
at all and let the Entry create a permalink based on the safeslug from the entry title.