35 local in_header = (next(parsed.objects) == nil) and (next(parsed.actions) == nil); |
36 local in_header = (next(parsed.objects) == nil) and (next(parsed.actions) == nil); |
36 if in_header and #line > 0 then |
37 if in_header and #line > 0 then |
37 if not parsed.title and not line:match("^#!") then |
38 if not parsed.title and not line:match("^#!") then |
38 parsed.title = line:gsub("^[#-]+%s*", ""); |
39 parsed.title = line:gsub("^[#-]+%s*", ""); |
39 elseif line:match("^##") then |
40 elseif line:match("^##") then |
40 if not parsed.tags then |
|
41 parsed.tags = {}; |
|
42 end |
|
43 local tag = line:gsub("^##%s*", ""); |
41 local tag = line:gsub("^##%s*", ""); |
44 local k, v = tag:match("^([^:]+):%s*(.+)$"); |
42 local k, v = tag:match("^([^:]+):%s*(.+)$"); |
45 if k then |
43 if k then |
46 -- Tag format: ## tagkey:tagvalue |
44 -- Tag format: ## tagkey:tagvalue |
47 parsed.tags[k] = v; |
45 parsed.tags[k] = v; |