Software /
code /
verse
Comparison
util/vcard.lua @ 310:c3e2b95b5b0b
util.vcard: Iterate on tags instead of items (thanks mva)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 09 Aug 2012 20:18:55 +0200 |
parent | 307:9d295d44a16e |
child | 311:de6e59e751eb |
comparison
equal
deleted
inserted
replaced
309:6297d658769f | 310:c3e2b95b5b0b |
---|---|
236 if prop_def.value then --single item | 236 if prop_def.value then --single item |
237 prop[1] = item:get_child_text(prop_def.value) or ""; | 237 prop[1] = item:get_child_text(prop_def.value) or ""; |
238 elseif prop_def.values then --array | 238 elseif prop_def.values then --array |
239 local value_names = prop_def.values; | 239 local value_names = prop_def.values; |
240 if value_names.behaviour == "repeat-last" then | 240 if value_names.behaviour == "repeat-last" then |
241 for i=1,#item do | 241 for i=1,#item.tags do |
242 t_insert(prop, item[i]:get_text() or ""); | 242 t_insert(prop, item.tags[i]:get_text() or ""); |
243 end | 243 end |
244 else | 244 else |
245 for i=1,#value_names do | 245 for i=1,#value_names do |
246 t_insert(prop, item:get_child_text(value_names[i]) or ""); | 246 t_insert(prop, item:get_child_text(value_names[i]) or ""); |
247 end | 247 end |