如何在 pyjade 中包含内联内容

发布于 2024-12-27 20:18:47 字数 176 浏览 4 评论 0原文

我的 jade 文件中有以下代码:

a(href='{{url_for("browse_problem", problem_id=problem._id)}}')

我试图评估 url_for 函数并将该值设置为 href 属性,但上面的代码不起作用。有人可以帮我改正吗?

I had the following code in my jade file:

a(href='{{url_for("browse_problem", problem_id=problem._id)}}')

I was trying to evaluate the url_for function and set the value as the href attribute, but the code above does not work. Can someone help me correct it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷鸟归林 2025-01-03 20:18:47

此错误已在 pyjade 的新版本 1.0 中修复。

一探究竟!

这个新代码与新版本完全兼容:

a(href=url_for("browse_problem", problem_id=problem._id))

This bug is fixed in the new version 1.0 of pyjade.

Check it out!

This new code is totally compatible with the new version:

a(href=url_for("browse_problem", problem_id=problem._id))

我自己通过更改 pyjade 中的一些代码解决了这个问题...在解析包括“class”或“id”的内容时似乎是一个错误。

I solved this problem myself by changing some code inside pyjade... Seems to be a bug when parsing content including 'class' or 'id'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文