【问题标题】:Summernote outputting code instead of formatted text in the browserSummernote 在浏览器中输出代码而不是格式化文本
【发布时间】:2015-07-03 21:12:46
【问题描述】:

我在流星中使用 mpowaga/meteor-autoform-summernote 包。但是,我能够成功地在数据库中插入数据,而在浏览器中输出数据时,它会显示这样的代码

<p><b>abstract text comes here...</b></p> 

而不是

这里是抽象文字...

文章架构

@Articles = new Meteor.Collection('articles');

Schema = {}

Schemas.Articles = new SimpleSchema
    abstract:
        optional:true
        type: String
        autoform:
            afFieldInput:
                type: 'summernote'
                class: 'abstract'
                height: 200

文章模板

<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>

【问题讨论】:

    标签: javascript meteor summernote


    【解决方案1】:

    你需要使用空格键模板的转义语法:

    {{{abstract}}}
    

    不会将其呈现为文本,而是呈现为 HTML。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-26
      • 2012-04-24
      • 2017-05-30
      • 1970-01-01
      • 1970-01-01
      • 2013-01-12
      • 1970-01-01
      • 2022-11-01
      相关资源
      最近更新 更多