Jinja2 highlight

I have installed jinja highlight in a small flask app. The highlighting works great when used directly in templates, but when I call it from the database and try to apply it on an entry, it does not render - it gives me the raw output from the db.

The code from the example:

{% highlight 'python' %}    
from fridge import Beer    
glass = Beer(lt=500)    
glass.drink()    
{% endhighlight %}

works in the template, but when I try to write and save an entry with the same content, the output is exactly the same, no formatting. I have tried {{ entry }}, {{entry|safe }} and the result is the same.

What am I doing wrong? While this is a particular jinja2 extension, I suppose the problem is more general.

Answers


Need Your Help

How Should I Implement Security On UDP Socket

c++ security sockets

I'm working on a peer to peer networking application but I cannot solve how I'm going to provide security on UDP sockets. I don't want to reinvent the wheel, but I don't which method I should cho...

How can I check to see if the user has Facebook Timeline?

facebook facebook-graph-api facebook-timeline

I want to enable certain features only for users with the "publish_actions" permission and Timeline. How can I detect if the user enabled Timeline?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.