changeset 550:b2139b21b49c 0.10

use Io.repr() in lucene/Web_search
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 17 Jun 2015 19:50:32 -0600
parents c69b4833a3a3
children 4d844caa0983
files lucene/src/luan/modules/lucene/Web_search.luan
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lucene/src/luan/modules/lucene/Web_search.luan	Mon Jun 15 18:33:48 2015 -0600
+++ b/lucene/src/luan/modules/lucene/Web_search.luan	Wed Jun 17 19:50:32 2015 -0600
@@ -5,6 +5,7 @@
 local range = Luan.range or error()
 local to_string = Luan.to_string or error()
 local Io = require "luan:Io"
+local repr = Io.repr or error()
 local Http = require "luan:http/Http"
 local String = require "luan:String"
 local string_to_number = String.to_number or error()
@@ -97,9 +98,12 @@
 				<% for i, row in ipairs(table) do %>
 					<tr>
 						<td><%=i%></td>
-						<% for col in range(1, #headers) do %>
-							<td><%= row[col] or "" %></td>
-						<% end %>
+						<%
+						for col in range(1, #headers) do
+							local val = row[col]
+							%><td><%= val and repr(val) or "" %></td><%
+						end
+						%>
 					</tr>
 				<% end %>
 			</table>