https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3APerson_length
Module:Person length - Revision history
2025-06-07T12:16:33Z
Revision history for this page on the wiki
MediaWiki 1.45.0-wmf.4
https://en.wikipedia.org/w/index.php?title=Module:Person_length&diff=920271903&oldid=prev
MusikBot II: Protected "Module:Person length": High-risk template or module (more info) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
2019-10-08T17:59:50Z
<p>Protected "<a href="/wiki/Module:Person_length" title="Module:Person length">Module:Person length</a>": <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk template or module</a> (<a href="/wiki/User:MusikBot_II/TemplateProtector" title="User:MusikBot II/TemplateProtector">more info</a>) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:59, 8 October 2019</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
MusikBot II
https://en.wikipedia.org/w/index.php?title=Module:Person_length&diff=920141754&oldid=prev
Frietjes at 22:21, 7 October 2019
2019-10-07T22:21:03Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 22:21, 7 October 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 38:</td>
<td colspan="2" class="diff-lineno">Line 38:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local force_cm = (enforce or '') == 'cm'</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local force_cm = (enforce or '') == 'cm'</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> unconverted = <del style="font-weight: bold; text-decoration: none;">clean</del>(s or '') -- basic unit cleaning</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> unconverted = <ins style="font-weight: bold; text-decoration: none;">clean_length</ins>(s or '') -- basic unit cleaning</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.gsub(unconverted, '&[Nn][Bb][Ss][Pp];', ' ')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> s = mw.ustring.gsub(unconverted, '&[Nn][Bb][Ss][Pp];', ' ')</div></td>
</tr>
</table>
Frietjes
https://en.wikipedia.org/w/index.php?title=Module:Person_length&diff=920141584&oldid=prev
Frietjes at 22:19, 7 October 2019
2019-10-07T22:19:45Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 22:19, 7 October 2019</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>-- This module implements [[Template:Infobox person/<del style="font-weight: bold; text-decoration: none;">height</del>]]</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>-- This module implements [[Template:Infobox person/<ins style="font-weight: bold; text-decoration: none;">length</ins>]]</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local p = {}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local p = {}</div></td>
</tr>
</table>
Frietjes
https://en.wikipedia.org/w/index.php?title=Module:Person_length&diff=920141550&oldid=prev
Frietjes: working on a lua version of Template:Infobox person/length
2019-10-07T22:19:29Z
<p>working on a lua version of <a href="/wiki/Template:Infobox_person/length" title="Template:Infobox person/length">Template:Infobox person/length</a></p>
<p><b>New page</b></p><div>-- This module implements [[Template:Infobox person/height]]<br />
<br />
local p = {}<br />
<br />
local function clean_length(s)<br />
s = mw.ustring.gsub(s, 'centimetre', 'cm')<br />
s = mw.ustring.gsub(s, 'centimeter', 'cm')<br />
s = mw.ustring.gsub(s, 'cms', 'cm')<br />
s = mw.ustring.gsub(s, 'cm%.', 'cm')<br />
s = mw.ustring.gsub(s, 'metre', 'm')<br />
s = mw.ustring.gsub(s, 'meter', 'm')<br />
s = mw.ustring.gsub(s, 'ms', 'm')<br />
s = mw.ustring.gsub(s, 'm%.', 'm')<br />
s = mw.ustring.gsub(s, 'inches', 'in')<br />
s = mw.ustring.gsub(s, 'inch', 'in')<br />
s = mw.ustring.gsub(s, 'ins', 'in')<br />
s = mw.ustring.gsub(s, 'in%.', 'in')<br />
s = mw.ustring.gsub(s, '%[%[[Cc]entim|cm%]%]', '[[Centimetre|cm]]')<br />
s = mw.ustring.gsub(s, '%[%[cm%]%]s', '[[Centimetre|cm]]')<br />
s = mw.ustring.gsub(s, '%[%[m%]%]s', '[[Metre|m]]')<br />
s = mw.ustring.gsub(s, '%[%[in|in%]%]', '[[inch|in]]')<br />
<br />
return s<br />
end<br />
<br />
local function isnumber(s)<br />
if s then<br />
s = mw.ustring.gsub(s, '%+%s*%d+%s*/%s*%d+%s*$', '')<br />
return tonumber(s)<br />
end<br />
return nil<br />
end<br />
<br />
local function get_convert_length_args(s, prefer, enforce)<br />
local prefer_m = (prefer or '') == 'm'<br />
local force_m = (enforce or '') == 'm'<br />
local prefer_cm = (prefer or '') == 'cm'<br />
local force_cm = (enforce or '') == 'cm'<br />
<br />
unconverted = clean(s or '') -- basic unit cleaning<br />
<br />
s = mw.ustring.gsub(unconverted, '&[Nn][Bb][Ss][Pp];', ' ')<br />
<br />
local m = mw.ustring.find(s, 'm')<br />
local c = mw.ustring.find(s, 'cm')<br />
local i = mw.ustring.find(s, 'in')<br />
<br />
if m == nil and i == nil then<br />
return '', unconverted<br />
end<br />
<br />
if c ~= nil and i == nil then<br />
local n = mw.ustring.sub(s, 1, c - 1)<br />
if isnumber(n) then<br />
return force_m<br />
and {n/100,'m','in',0,['abbr']='on'}<br />
or {n,'cm','in',0,['abbr']='on'}, mw.ustring.sub(s, c+2)<br />
end<br />
return '', unconverted<br />
end<br />
<br />
if m ~= nil and c == nil and i == nil then<br />
local n = mw.ustring.sub(s, 1, m - 1)<br />
if isnumber(n) then<br />
return force_cm <br />
and {n*100,'cm','in',0,['abbr']='on'}<br />
or {n,'m','in',0,['abbr']='on'}, mw.ustring.sub(s, m+1)<br />
end<br />
return '', unconverted<br />
end<br />
<br />
if i ~= nil and m == nil then<br />
local n = mw.ustring.sub(s, 1, i - 1)<br />
if isnumber(n) then<br />
return (force_m or prefer_m)<br />
and {n,'in','m',2,['abbr']='on'}<br />
or {n,'in','cm',0,['abbr']='on'}, mw.ustring.sub(s, i+2)<br />
end<br />
return '', unconverted<br />
end<br />
<br />
return '', unconverted<br />
end<br />
<br />
function convert_length(frame, args)<br />
local targs, str = get_convert_length_args(args[1], args['prefer'] or '', args['enforce'] or '')<br />
<br />
if type(targs) == 'table' then<br />
return frame:expandTemplate{ title = 'convert', args = targs} .. str<br />
else<br />
return str<br />
end<br />
end<br />
<br />
function p.length(frame)<br />
return convert_length(frame, frame.args[1] and frame.args or frame:getParent().args)<br />
end<br />
<br />
return p</div>
Frietjes