Closed rouge8 closed 12 years ago
I also use Jekyll and think Liquid support is a good idea. However, I'm unfamiliar with the Liquid syntax you describe in your example.
When converting from referenced to inline, how does ![description]({{)
denote the photo hello.jpg
? There is no reference to the file path?
Oh sorry, I was describing the bug.
I started with this: ![description]({{ site.photos }}/hello.jpg
I converted to reference links and got this [1]: {{ site.photos }}/hello.jpg
I converted back to inline once more and got ![description]({{)
, which is incorrect.
With my commit, after I convert back from reference links, I get ![description]({{ site.photos }}/hello.jpg
, which is expected.
Is that clearer?
Ok, I'm clear with what you are describing now. Thanks for the added details.
The only complication I see with your pull is with breaking certain referenced markdown syntax when it is converted from referenced to inline. For example:
This is [an example][foo]
reference-style link.
[foo]: http://example.com/ (Optional Title Here)
The above example when switched to inline gives:
This is [an example](http://example.com/ (Optional Title Here))
reference-style link.
I've tried three different markdown engines all of which render this inline markdown differently:
Maruku renders: This is an example) reference-style link.
Marked renders: This is [an example](http://example.com/ (Optional Title Here)) reference-style link.
nvALT gives: This is an example reference-style link.
Using parentheses with the optional title is the only case where problems arise. Using quotes "Optional Title Here"
renders correctly.
I believe nvALT uses a multi-markdown engine, so that may explain why it is producing the correct HTML.
When converting to inline links, splitting on whitespace prevents using things like template variables in your links.
e.g.
would become
I don't know how common this is, and it doesn't seem to go against the markdown spec (it's also accepted by maruku, kramdown, and rdiscount FWIW), but it's something I use with Jekyll.