[FIX] Problem with commented lines in configuration files

This commit is contained in:
Olivier DOSSMANN 2013-05-14 16:19:35 +02:00
parent c5bb0284ee
commit 73557fb83b

View File

@ -11,7 +11,7 @@ function process(filepath)
-- parse given file -- parse given file
for line in io.lines(filepath) do for line in io.lines(filepath) do
-- check if this line is a comment ("# my comment"), a category ("[[My category]]Its description") or an element ("Title##Description##URL##Image") -- check if this line is a comment ("# my comment"), a category ("[[My category]]Its description") or an element ("Title##Description##URL##Image")
is_comment = string.find(line, '^#(.*)') is_comment = string.find(line, '^#+.*')
is_title = string.find(line, '%[%[(.*)%]%](.*)') is_title = string.find(line, '%[%[(.*)%]%](.*)')
is_element = string.find(line, '(.*)##(.*)##(.*)##(.*)') is_element = string.find(line, '(.*)##(.*)##(.*)##(.*)')
if is_comment then if is_comment then