Module:Lang: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 434:
if not is_set (args.text) then
return make_error_msg ('{{lang-xx}}: no text', args.no_cat);
end
 
----------
if args.text:find ("\'\'\'\'\'[\']+") then
return make_error_msg ('{{lang-xx}}: text has malformed markup', args.no_cat);
end
 
Line 440 ⟶ 445:
end
 
if args.text:matchfind ("^\'[^\']+\'\'") then -- first character is single \' which may interfere with italic markup; convertfour toapostrophes entity
return make_error_msg ('{{lang-xx}}: text has malformed markup', args.no_cat);
args.text:gsub ("^\'", ''')
end
 
if args.text:sub(1,1) == "'" then args.text = "<span></span>" .. args.text; end
if args.text:match ("[^\']\'$") then -- last character is single \' which may interfere with italic markup; convert to entity
if args.text:sub(-1,-1) == "'" then args.text = args.text .. "<span></span>"; end
args.text:gsub ("\'$", '&#39;')
----------
end
 
args.code = format_ietf_tag (code, script, region, variant); -- format to recommended subtag styles
Anonymous user