getpelican/pelican — pull request #642 by kdeldycke (2013-11-26 10:55:12+00:00)
Title: Remove `--reference-links` parameter from pelican-import

When importing WordPress content from its XML export, I have the following post content:

```xml
(...)

post
(...)
<a href="http://kevin.deldycke.com/wp-content/uploads/2012/11/conversation.png"><img src="http://kevin.deldycke.com/wp-content/uploads/2012/11/conversation-162x288.png" alt="" title="conversation" width="162" height="288" class="aligncenter size-large wp-image-5378" /></a>
(...)

(...)
```

It's transformed by `pelican-import` to this Markdown:

```markdown
[![][]][]

[]: http://kevin.deldycke.com/wp-content/uploads/2012/11/conversation-162x288.png
"conversation"
[![][]]: http://kevin.deldycke.com/wp-content/uploads/2012/11/conversation.png
```

Which in returns produce this HTML in Pelican:

```html

[][]

[]: http://kevin.deldycke.com/wp-content/uploads/2012/11/conversation.png

```

This is wrong.

Now, with this patch:

```diff
--- ./pelican-3.1.1/pelican/tools/pelican_import.py.orig 2012-12-13 19:23:09.942693101 +0100
+++ ./pelican-3.1.1/pelican/tools/pelican_import.py 2012-11-15 20:07:08.000000000 +0100
@@ -246,7 +246,7 @@

parse_raw = '--parse-raw' if not strip_raw else ''
- cmd = ('pandoc --normalize {0} --from=html'
+ cmd = ('pandoc --normalize --reference-links {0} --from=html'
' --to={1} -o "{2}" "{3}"').format(
parse_raw, out_markup, out_filename, html_filename)

```

pelican-import produce the following Markdown:

```markdown
[![](http://kevin.deldycke.com/wp-content/uploads/2012/11/conversation-162x288.png "conversation")](http://kevin.deldycke.com/wp-content/uploads/2012/11/conversation.png)
```

Which is much better, as it produce the following HTML in Pelican:

```html

```

As `--reference-links` seems to do more harm than good (see #348). I propose to remove this parameter.