imathis / octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
http://github.com/imathis/octopress
9.31k stars 2.62k forks source link

category_feed.xml doubleescapes, causes markdown fail #884

Open tarasglek opened 11 years ago

tarasglek commented 11 years ago

I had some {\% in urls in my blog posts which rendered fine, except some of my posts(in atom) wouldn't render plugins. I also noticed the following error. Fixing it, fixed atom content rendering.

Liquid Exception: Tag '{%' was not properly terminated with regexp: /\%}/ in atom.xml Liquid Exception: Tag '{%' was not properly terminated with regexp: /\%}/ in atom.xml

The fix is simple. This makes category_feed.xml match atom.xml

parkr commented 11 years ago

Good catch, thanks!

imathis commented 11 years ago

Unfortunately this forces all posts to be run through the markdown filter. Some may choose to blog with HTML or Textile, or any other template system they've added a converter for. Passing that content through the markdown filter may have unexpected results. Can you please provide an example of some content which can demonstrate this problem so I can attempt to solve this in a more suitable way?

tarasglek commented 11 years ago

Since filing this I realized that above is not a solution. The problem appears to be that global atom.xml is being fed data that's markdownified, whereas category feed is fed somethat is only partially converted to html(ie some plugins don't get expanded until the markdownify is called in category atoms(which my suggestion above removes).

The problem is that my wp-imported markdown contained links like

Which contain {% which causes error messages while generating the blog...If I then fix these in my markdown to be {\%, then category feed code tries to convert it to markdown again

imathis commented 11 years ago

I can't really see your example. Please post it in a code block so I can see the source as GitHub is attempting to display it as markdown.

tarasglek commented 11 years ago

I can't get the markdown to show up, http://pastebin.mozilla.org/2048701 has the link source

parkr commented 11 years ago

This is the output?

[![](/assets/images/2012-06-14-snappy-june-14th-telemetry-investigations/cache_lock_mainthread_crap.jpg.png)](https://metrics.mozilla.com/data/content/pentaho-cdf-dd/Render?solution=metrics2&path=%2Ftelemetry&file=telemetryEvolution.wcdf&bookmarkState={%22impl%22%3A%22client%22%2C%22params%22%3A{%22appNameParameter%22%3A%22[Application].[Firefox]%22%2C%22channelParameter%22%3A%22[Channel].[nightly]%22%2C%22osParameter%22%3A%22[OS].[WINNT]%22%2C%22histogramParameter%22%3A%22[Histogram].[CACHE_SERVICE_LOCK_WAIT_MAINTHREAD]%22%2C%22referenceDate%22%3A%222012-06-14%22%2C%22histogramPopupTools%22%3A%22%22%2C%22duplicateHistogram%22%3A%22%23duplicateHistogram%22%2C%22medianButtonParam%22%3A0%2C%22scatterChart%22%3A%22%22}})
tarasglek commented 11 years ago

yes

imathis commented 11 years ago

Um, wow. crap.jpg.png... is a very strange image link. I'll see what I can do to get things working, but man, I feel sorry for you having to use urls like that.

pluton8 commented 11 years ago

Hi all. I have the same errors when I use the {% post_url ... %} tag. @imathis, I've created a branch with two posts where the issue is easily reproduced: https://github.com/pluton8/octopress/tree/post_url_test

btw, in my own blog branch (merged with master from this commit e63a0f1c3bb6e3f339d37af934c60400aa3059d3) liquid just throws these exceptions, but continues to build the blog. However, when I merged in the latest changes, the build fails on the first exception.

pwnall commented 11 years ago

I ran into these errors while using post_url in an Octopress blog branched off the 2.5 branch.

The solution here worked for me: https://github.com/davidfstr/rdiscount/issues/75

I don't know why markdownize works where markdownify fails, but I'd be happy to send a PR, if it helps.