JTemplate and MicrosoftAjaxTemplates encode or decode html (browser does not display as html)

I am using jTemplate to display an rss element on my page. but the description of each item is not displayed correctly.

My template:

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Title</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    {#foreach $T.Items as post}
    <tr>
      <td>{$T.post.PubDate}</td>
      <td><a href="{$T.post.Link}">{$T.post.Title}</a></td>
      <td>{$T.post.Description}</td>
    </tr>
    {#/for}
  </tbody>
</table>

but when on the rendering page I see a tag (or an encoded tag) instead of html rendering in the description column:

& lt; table border = 0 width = valign = top cellpadding = 2 cellspacing = 7 & GT; & l; TR & GT; & lt; td width = 80 align = center valign = top & GT; & l; font style = "font size: 85%; font family: Arial, sans-serif" & GT; ....

And when server side html decoding, see

< table border = 0 width = valign = top CELLPADDING = 2 CELLSPACING = 7 > < & GT; < width = 80 align = center VALIGN = > < = " : 85%; : Arial, " > ....

?

. MicrosoftAjaxTemplates , , $('. desc'). append ('any html tag');

+3
1

jTemplates HTML . , :

.setTemplate("#template", null, { filter_data: false });

+2

Source: https://habr.com/ru/post/1729699/


All Articles