1
0
mirror of https://github.com/openresty/openresty.git synced 2024-10-13 00:29:41 +00:00
Files
FreeBSD
clients
demo
Blog
css
image
js
misc
template
elem
archive-list.tt
archive-nav.tt
calendar.tt
comments.tt
nav.tt
pager.tt
post-list.tt
post-page.tt
post.tt
recent-comments.tt
recent-posts.tt
banner.tt
footer.tt
header.tt
index.tt
sidebar.tt
misc
patches
specs
t
util
.gitignore
Makefile
README
openresty/demo/Blog/template/elem/comments.tt
2010-01-25 03:05:37 +08:00

30 lines
1.2 KiB
Plaintext

[%- FOREACH comment IN comments -%]
<a name="post-[% comment.post %]:comment-[% comment.id %]" id="post-[% comment.post %]:comment-[% comment.id %]"></a>
<div class="comment" id="comment-95523406">
<div class="comment-content">
[%- IF comment.body %]
[%- comment.body.replace('&', '&amp;')
.replace('<', '&lt;')
.replace('>', '&gt;')
.replace('\n', '<br/>')
.replace(' ', '&nbsp; ')
.replace('(http://(?:\%[A-Fa-f0-9]{2}|[-A-Za-z./0-9~_])+)', '<a href="$1">$1</a>') %]
[%- END %]
</div>
<p class="comment-footer">
Posted by:
[% IF comment.url %]
[%- url = comment.url %]
[% IF NOT url.match('^\\w+://');
url = 'http://' _ url;
END -%]
<a href="[% url | html %]">[% comment.sender | html %]</a>
[% ELSE %]
[% comment.sender | html %] |
[% END %]
[% comment.created | html %]
</p>
</div>
[%- END %]