Content deleted Content added
No edit summary |
No edit summary |
||
Line 26:
local function get_lang_script_region_parts (element)
local code;
local descriptions = {};
local in_comments = false;
for line in mw.ustring.gmatch (element, '([^\n]+)\n') do -- get a \n terminate line of text (without the \n)
Line 34 ⟶ 35:
elseif mw.ustring.match (line, 'Description: .+') then -- if this line is a description line
table.insert (descriptions, '\"' .. mw.ustring.match (line, 'Description: (.+)') .. '\"'); -- extract and save the name wrapped in quote marks
elseif mw.ustring.match (line, '
in_comments = true;
elseif mw.ustring.match (line, '^ .+') and not in_comments then -- if a continuation line but not a commnets continuation
descriptions[#descriptions] = mw.ustring.gsub (descriptions[#descriptions], '\"$', ''); -- remove trailing quote mark from previous description
descriptions[#descriptions] = descriptions[#descriptions] .. ' ' .. mw.ustring.match (line, '^ (.+)') .. '\"'; -- extract and save the continuation with new quote mark
|