<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Oh, good then it was only issue number one, the escaping.<div><br></div><div>Please check the jinja2 documentation about "|safe" it is specially important to do so because it implies some security considerations. You are now going to push raw content to your html.</div><div><br></div><div><a href="http://jinja.pocoo.org/docs/dev/templates/#safe" target="_blank">http://jinja.pocoo.org/docs/dev/templates/#safe</a></div><div><br></div><div>Federico</div><br><div>> Date: Thu, 27 Aug 2015 01:57:58 +0530<br>> Subject: Re: [Flask] SVG Viewer Problem<br>> From: arsh840@gmail.com<br>> To: fededelgado@outlook.com<br>> <br>> On Mon, Aug 24, 2015 at 6:19 AM, Federico Delgado Doyle<br>> <fededelgado@outlook.com> wrote:<br>> ><br>> > Hi Great Avenger,<br>> ><br>> > I have not used that file browser. But from a fast inspection I see that the file content is going to be escaped. That is one thing. The other one is, the SVG is not being requested as an image/svg+xml image so I don't thing that the browser is going to show it. The template says:<br>> ><br>> > <div class="row"><br>> > <div style="white-space:pre;">{{ text }}</div><br>> > </div><br>> ><br>> > Maybe you can try to render differently according to the type of file. For example if extension is a kind of image, >create a view_image action that renders differently.<br>> <br>> Hi Federico and Everyone.<br>> <br>> Thanks for reply I am able to solve it.<br>> I just added<br>> <br>> {{text|safe}} in my html file and it worked. :)<br>> <br>> As Python code is as follows:<br>> <br>> http://pastebin.com/7sNgJgQ9<br>> <br>> As only using {{text}} does not work but {{text|safe}} does work, What<br>> "safe" keyword stands for?<br>> <br>> By the way I got it from following:<br>> <br>> http://stackoverflow.com/questions/25195290/generating-dynamic-pygal-chart-in-flask<br>> <br>> -- <br>> <br>> Thanks<br>> Arshpreet Singh<br>> <br>> I am Sikh boy, Learning by doing and Learning by teaching is my religion.<br>> ------------------------------------------------------------------------------<br>> Slashdot TV.<br>> Video for Nerds.  Stuff that matters.<br>> http://tv.slashdot.org/<br></div>                                      </div></body>
</html>