why can't i display data from a postgres table in html

hey so i'm storing a string like '<h1>test</h1><br><br><h1>yep</h1>' in a table then displaying the result on my webserver, the problem is that the string is exactly that, i'm trying to make it so it will acutally use the h1 tag in the source.

the type of the column i'm storing it in is text, i'm using mako templating system and pyramid web framework

heres what im getting:

here's what i want it to look like

i'm just using a textarea tag to input data into the table.

edit: how i'm adding the string into the db

    post_subject = request.params.get("subject")
    post_message = request.params.get("message")
    # some other stuff .....
    cur.execute("\
        INSERT INTO bulbs_Post (subcategory_id, parent_post, title, content, date, user_id, ip) VALUES \
        (%s, %s, %s, %s, now(), %s, %s)", (forum_id, parent_id, post_subject, post_message, user_id, request.client_addr))

i'm displaying the content in the template by using ${post_content}

Answers


Alright I have figured it out, turns out when displaying the content mako was filtering the data anyways. I was able to declare the variable safe using ${post_content | n}

http://docs.makotemplates.org/en/latest/filtering.html#turning-off-filtering-with-the-n-filter


Need Your Help

is there a way to programatically “select all” in a mobile web input textbox or contenteditable area?

cordova mobile-website ionic-framework mobile-webkit

I'd like to select all in an input textbox or contenteditable span so the user doesn't have to backspace or delete an input text to overwrite.

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.