普通网友 2016-06-12 00:59
浏览 29

在Jade中,如何在不转义返回的字符串的情况下调用函数?

I'm using jade as part of a simple website using golang as the backend.

As part of this I have jade that looks like this:

p#{printf("%s", Body)}

I'm using the package github.com/go-floki/jade to compile this into an executable go template. The function printf is a go builtin that is run once the template is executed.

The problem is that I want unescaped html. The jade doc seems to indicate that this:

p!{printf("%s", Body)}

should work but that just ends up as:

<p>printf("%s", Body)}</p>

Is there a way to escape the function without escaping its argument?

Thanks, Zac

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思