正在呈现的html标记而不是值

时间:2017-07-03 03:26:31

标签: javascript html ejs

我正在尝试将已保存的Rich Text从Mongodb数据库呈现到ejs页面。未渲​​染部分的ejs是这样的:

using ZipFile
using DataFrames
function process_zip(zip::ZipFile.ReadableFile)

    if split(zip.name,".")[end] == "zip"

        iobuffer = IOBuffer(readstring(zip))
        r = ZipFile.Reader(iobuffer)

        for f in r.files
            process_zip(f) 
        end
    end

    if split(zip.name,".")[end] == "csv"
         df = readtable(zip) #for now just read it into a dataframe
    end

end

r = ZipFile.Reader("yourzipfilepathhere");

for f in r.files
    process_zip(f)
end
close(r)

因为它是一个富文本,我的html标签在我的db.Now中保存了很长的值,当我尝试将其渲染到我的页面时,我将整个事物作为字符串标记而不是获得渲染值。 / p>

enter image description here

正如您所看到的,除了我保存的富文本外,页面的其余部分正常呈现。

感谢任何帮助。

THX

1 个答案:

答案 0 :(得分:1)

<%- YOUR_HTML_CONTENT %>中使用

{{1}}将呈现HTML内容

相关问题