如何在Pug文件中插入原始HTML(不包括外部HTML文件) [英] How to insert raw HTML in Pug file (not include external HTML file)

查看:85
本文介绍了如何在Pug文件中插入原始HTML(不包括外部HTML文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我要把一些多行HTML放入Pug文件中,却找不到任何方法.

So what I want is to put some multiline HTML into a Pug file and can't find anywhere how to do this.

示例:

html
    head

    body
        <div><a href="lala"> blabla </a></div>

        p hihuhohoo

推荐答案

哈巴狗 text 可以包含HTML.只需将其强制为文本,它就应该解析:

Pug text can include HTML. Just force it as text, and it should parse:

html
    head

    body
        | <div><a href="lala"> blabla </a></div>

        p hihuhohoo

此外,您使用反斜杠(而不是正斜杠)来关闭元素.

Also, you were using backslashes, not forward slashes, to close elements.

这篇关于如何在Pug文件中插入原始HTML(不包括外部HTML文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆