javascript - Summernote outputting code instead of formatted text in the browser -
i'm using mpowaga/meteor-autoform-summernote package inside meteor. able insert data in database however, while outputting data in browser shows code
<p><b>abstract text comes here...</b></p>
instead of
abstract text comes here...
article schema
@articles = new meteor.collection('articles'); schema = {} schemas.articles = new simpleschema abstract: optional:true type: string autoform: affieldinput: type: 'summernote' class: 'abstract' height: 200
article template
<table class="table table-bordered article-table"> <tbody> {{#each articles}} <tr> <td colspan="2"> <h3>{{title}}</h3> <p class="abstract-wrapper"> <p class="abstracts"> {{abstract}} </p> </p> </td> <td> <button type="button" class="btn btn-primary edit">edit</button> </td> <td> <button type="button" class="btn btn-danger delete">delete</button> </td> </tr> {{/each}} </tbody> </table>
you need use escape syntax of spacebar templates:
{{{abstract}}}
will not render text, html.
Comments
Post a Comment