mirror of
				https://github.com/openresty/openresty.git
				synced 2024-10-13 00:29:41 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| [%- 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('&', '&')
 | |
|                             .replace('<', '<')
 | |
|                             .replace('>', '>')
 | |
|                             .replace('\n', '<br/>')
 | |
|                             .replace('  ', '  ')
 | |
|                             .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 %]
 | |
| 
 |