ejs怎么做超链接
如题,代码如下:
<div class="post-content">
<div class="ui grid">
<div class="four wide column">
<a class="avatar avatar-link"
href="/bookmarks?author=<%= bookmark.author._id %>"
data-title="<%= bookmark.author.name %> | <%= ({m: '男', f: '女', x: '保密'})[bookmark.author.gender] %>"
data-content="<%= bookmark.author.bio %>">
<img class="avatar" src="/img/<%= bookmark.author.avatar %>">
</a>
</div>
<div class="eight wide column">
<div class="ui segment">
<h3><a href="/bookmarks/<%= bookmark._id %>"><%= bookmark.title %></a></h3>
<h3><a href="<%- bookmark.url %>"><%= bookmark.title %></a></h3>
<%- bookmark.url %>
<img class="favicon" width="32" height="32" src="/upload/<%= bookmark.favicon %>">
<div>
<span class="tag"><%= bookmark.created_at %></span>
<span class="tag right">
<% if (user && bookmark.author._id && user._id.toString() === bookmark.author._id.toString()) { %>
<div class="ui inline dropdown">
<div class="text"></div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="item"><a href="/bookmarks/<%= bookmark._id %>/bookmarkedit">编辑</a></div>
<div class="item"><a href="/bookmarks/<%= bookmark._id %>/remove">删除</a></div>
</div>
</div>
<% } %>
</span>
</div>
</div>
</div>
</div>
</div>
结果(源代码):
<div class="eight wide column">
<div class="ui segment">
<h3><a href="/bookmarks/5b768c91f41d520dcc53c559">EJS -- 嵌入式 JavaScript 模板引擎 | EJS 中文文档</a></h3>
<h3><a href="<p><a href="https://ejs.bootcss.com/">https://ejs.bootcss.com/</a></p>
">EJS -- 嵌入式 JavaScript 模板引擎 | EJS 中文文档</a></h3>
<p><a href="https://ejs.bootcss.com/">https://ejs.bootcss.com/</a></p>
<img class="favicon" width="32" height="32" src="/upload/5b591940df2f820367488075ejs.bootcss.com.ico">
<div>
<span class="tag">2018-08-17 16:51</span>
<span class="tag right">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
<h3>