https://en.seminaverbi.bibleget.io/w/index.php?title=Module:Footnotes&feed=atom&action=history
Module:Footnotes - Revision history
2024-03-29T05:23:30Z
Revision history for this page on the wiki
MediaWiki 1.41.0
https://en.seminaverbi.bibleget.io/w/index.php?title=Module:Footnotes&diff=26091&oldid=prev
Johnrdorazio: 1 revision imported
2021-10-03T16:49:19Z
<p>1 revision imported</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;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:49, October 3, 2021</td>
</tr><tr><td colspan="4" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr>
<!-- diff cache key seminaverbi_en:diff:1.41:old-26090:rev-26091 -->
</table>
Johnrdorazio
https://en.seminaverbi.bibleget.io/w/index.php?title=Module:Footnotes&diff=26090&oldid=prev
en>Trappist the monk at 12:03, September 14, 2021
2021-09-14T12:03:42Z
<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;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:03, September 14, 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l320">Line 320:</td>
<td colspan="2" class="diff-lineno">Line 320:</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> args.page = pframe.args.p or pframe.args.page or '';</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> args.page = pframe.args.p or pframe.args.page or '';</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> args.pages = pframe.args.pp or pframe.args.pages or '';</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> args.pages = pframe.args.pp or pframe.args.pages or '';</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> args.pages = hyphen_to_dash (args.pages);</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> args.pages = <ins style="font-weight: bold; text-decoration: none;">('' ~= args.pages) and </ins>hyphen_to_dash (args.pages) <ins style="font-weight: bold; text-decoration: none;">or ''</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;"><div> args.location = pframe.args.loc or '';</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> args.location = pframe.args.loc or '';</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> args.ref = pframe.args.ref or pframe.args.Ref or '';</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> args.ref = pframe.args.ref or pframe.args.Ref or '';</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l476">Line 476:</td>
<td colspan="2" class="diff-lineno">Line 476:</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> args.page = pframe.args[table.concat ({n, 'p'})] or ''; -- insource locations for this source</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> args.page = pframe.args[table.concat ({n, 'p'})] or ''; -- insource locations for this source</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> args.pages = pframe.args[table.concat ({n, 'pp'})] or '';</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> args.pages = pframe.args[table.concat ({n, 'pp'})] or '';</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> args.pages = hyphen_to_dash (args.pages);</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> args.pages = <ins style="font-weight: bold; text-decoration: none;">('' ~= args.pages) and </ins>hyphen_to_dash (args.pages) <ins style="font-weight: bold; text-decoration: none;">or ''</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;"><div> args.location = pframe.args[table.concat ({n, 'loc'})] or '';</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> args.location = pframe.args[table.concat ({n, 'loc'})] or '';</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> args.ignore = ('yes' == pframe.args[table.concat ({n, 'ignore-false-positive'})]) or ('yes' == pframe.args[table.concat ({n, 'ignore-err'})]);</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> args.ignore = ('yes' == pframe.args[table.concat ({n, 'ignore-false-positive'})]) or ('yes' == pframe.args[table.concat ({n, 'ignore-err'})]);</div></td></tr>
<!-- diff cache key seminaverbi_en:diff:1.41:old-25958:rev-26090:php=table -->
</table>
en>Trappist the monk
https://en.seminaverbi.bibleget.io/w/index.php?title=Module:Footnotes&diff=25958&oldid=prev
Johnrdorazio: 1 revision imported
2021-09-13T17:13:19Z
<p>1 revision imported</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;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:13, September 13, 2021</td>
</tr><tr><td colspan="4" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr>
<!-- diff cache key seminaverbi_en:diff:1.41:old-25957:rev-25958 -->
</table>
Johnrdorazio
https://en.seminaverbi.bibleget.io/w/index.php?title=Module:Footnotes&diff=25957&oldid=prev
en>Trappist the monk: +hyphen_to_dash();
2021-09-13T15:02:28Z
<p>+hyphen_to_dash();</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;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:02, September 13, 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l48">Line 48:</td>
<td colspan="2" class="diff-lineno">Line 48:</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> if 10 == namespace then</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> if 10 == namespace then</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> return ''; -- automatic form of |<del style="font-weight: bold; text-decoration: none;">template</del>-<del style="font-weight: bold; text-decoration: none;">doc-demo</del>=<del style="font-weight: bold; text-decoration: none;">true</del>; TODO: is this too broad?</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> return ''; -- automatic form of |<ins style="font-weight: bold; text-decoration: none;">no</ins>-<ins style="font-weight: bold; text-decoration: none;">tracking</ins>=<ins style="font-weight: bold; text-decoration: none;">yes</ins>; TODO: is this too broad?</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> end</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> end</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 colspan="2" class="diff-lineno" id="mw-diff-left-l105">Line 105:</td>
<td colspan="2" class="diff-lineno">Line 105:</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> elseif 1 < tally then</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> elseif 1 < tally then</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> msg = 'multiple targets (' .. tally .. '×): ' .. anchor_id; -- more than one anchor_id in this article</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> msg = 'multiple targets (' .. tally .. '×): ' .. anchor_id; -- more than one anchor_id in this article</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> category = '[[Category:Harv and Sfn multiple-target errors]]';</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> category = <ins style="font-weight: bold; text-decoration: none;">0 == namespace and </ins>'[[Category:Harv and Sfn multiple-target errors]]' <ins style="font-weight: bold; text-decoration: none;">or ''; -- only categorize in article space</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> return '<span class="error harv-error" style="display: inline; font-size:100%"> ' .. args.template .. ' error: ' .. msg .. ' ([[:Category:Harv and Sfn template errors|help]])</span>' .. category</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;"><div> end</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> end</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 colspan="2" class="diff-lineno" id="mw-diff-left-l230">Line 230:</td>
<td colspan="2" class="diff-lineno">Line 231:</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> result = table.concat ({args.bracket_left, result, args.bracket_right, args.postscript}):gsub ('%s+', ' '); -- strip redundant spaces</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> result = table.concat ({args.bracket_left, result, args.bracket_right, args.postscript}):gsub ('%s+', ' '); -- strip redundant spaces</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> return result .. err_msg;</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> return result .. err_msg;</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">end</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">Converts a hyphen to a dash under certain conditions. The hyphen must separate</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">like items; unlike items are returned unmodified. These forms are modified:</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> letter - letter (A - B)</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> digit - digit (4-5)</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> letterdigit - letterdigit (A1-A5) (an optional separator between letter and</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> digit is supported – a.1-a.5 or a-1-a-5)</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> digitletter - digitletter (5a - 5d) (an optional separator between letter and</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> digit is supported – 5.a-5.d or 5-a-5-d)</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">any other forms are returned unmodified.</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">str may be a comma- or semicolon-separated list</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">This code copied from Module:Citation/CS1. The only modification is to require Module:Citation/CS1/Utilities</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">so that it has access to the functions is_set() and has_accept_as_written()</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">]]</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;">local function hyphen_to_dash( str )</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> local utilities = require ('Module:Citation/CS1/Utilities'); -- only modification so that this function has access to is_set() and has_accept_as_written()</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> if not utilities.is_set (str) then</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> return str;</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> end</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> local accept; -- Boolean</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> str = str:gsub ('&[nm]dash;', {['&ndash;'] = '–', ['&mdash;'] = '—'}); -- replace &mdash; and &ndash; entities with their characters; semicolon mucks up the text.split</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> str = str:gsub ('&#45;', '-'); -- replace HTML numeric entity with hyphen character</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> str = str:gsub ('&nbsp;', ' '); -- replace &nbsp; entity with generic keyboard space character</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> </ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> local out = {};</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> for _, item in ipairs (list) do -- for each item in the list</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> item, accept = utilities.has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> else</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> end</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> end</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> table.insert (out, item); -- add the (possibly modified) item to the output table</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> end</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> local temp_str = ''; -- concatenate the output table into a comma separated string</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> temp_str, accept = utilities.has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> if accept then</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> temp_str = utilities.has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> return temp_str;</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> else</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> return temp_str; -- else, return assembled temp_str</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> end</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;"><div>end</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>end</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 colspan="2" class="diff-lineno" id="mw-diff-left-l254">Line 254:</td>
<td colspan="2" class="diff-lineno">Line 320:</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> args.page = pframe.args.p or pframe.args.page or '';</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> args.page = pframe.args.p or pframe.args.page or '';</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> args.pages = pframe.args.pp or pframe.args.pages or '';</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> args.pages = pframe.args.pp or pframe.args.pages or '';</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> args.pages = hyphen_to_dash (args.pages);</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;"><div> args.location = pframe.args.loc or '';</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> args.location = pframe.args.loc or '';</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> args.ref = pframe.args.ref or pframe.args.Ref or '';</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> args.ref = pframe.args.ref or pframe.args.Ref or '';</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l409">Line 409:</td>
<td colspan="2" class="diff-lineno">Line 476:</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> args.page = pframe.args[table.concat ({n, 'p'})] or ''; -- insource locations for this source</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> args.page = pframe.args[table.concat ({n, 'p'})] or ''; -- insource locations for this source</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> args.pages = pframe.args[table.concat ({n, 'pp'})] or '';</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> args.pages = pframe.args[table.concat ({n, 'pp'})] or '';</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></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><ins style="font-weight: bold; text-decoration: none;"> args.pages = hyphen_to_dash (args.pages);</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;"><div> args.location = pframe.args[table.concat ({n, 'loc'})] or '';</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> args.location = pframe.args[table.concat ({n, 'loc'})] or '';</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> args.ignore = ('yes' == pframe.args[table.concat ({n, 'ignore-false-positive'})]) or ('yes' == pframe.args[table.concat ({n, 'ignore-err'})]);</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> args.ignore = ('yes' == pframe.args[table.concat ({n, 'ignore-false-positive'})]) or ('yes' == pframe.args[table.concat ({n, 'ignore-err'})]);</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><del style="font-weight: bold; text-decoration: none;">-- args.ignore = 'yes' == pframe.args[table.concat ({n, 'ignore-err'})];</del></div></td><td colspan="2" class="diff-side-added"></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> table.insert (out, core (args)); -- save the rendering of this source</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> table.insert (out, core (args)); -- save the rendering of this source</div></td></tr>
<!-- diff cache key seminaverbi_en:diff:1.41:old-21860:rev-25957:php=table -->
</table>
en>Trappist the monk
https://en.seminaverbi.bibleget.io/w/index.php?title=Module:Footnotes&diff=21860&oldid=prev
Johnrdorazio: 1 revision imported
2020-09-02T12:20:16Z
<p>1 revision imported</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;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:20, September 2, 2020</td>
</tr><tr><td colspan="4" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr>
<!-- diff cache key seminaverbi_en:diff:1.41:old-21859:rev-21860 -->
</table>
Johnrdorazio
https://en.seminaverbi.bibleget.io/w/index.php?title=Module:Footnotes&diff=21859&oldid=prev
en>Trappist the monk at 18:32, May 23, 2020
2020-05-23T18:32:01Z
<p></p>
<p><b>New page</b></p><div>require('Module:No globals');<br />
local getArgs = require ('Module:Arguments').getArgs;<br />
<br />
<br />
--[[--------------------------< A R G S _ D E F A U L T >------------------------------------------------------<br />
<br />
a table to specify initial values.<br />
<br />
]]<br />
<br />
local args_default = {<br />
bracket_left = '',<br />
bracket_right = '',<br />
bracket_year_left = '',<br />
bracket_year_right = '',<br />
postscript = '',<br />
page = '',<br />
pages = '',<br />
location = '',<br />
page_sep = ", p.&nbsp;",<br />
pages_sep = ", pp.&nbsp;",<br />
ref = '',<br />
template = 'harv', -- if template name not provided in {{#invoke:}} use this<br />
};<br />
<br />
<br />
--[[--------------------------< T A R G E T _ C H E C K >------------------------------------------------------<br />
<br />
look for anchor_id (CITEREF name-list and year or text from |ref=) in anchor_id_list<br />
<br />
the 'no target' error may be suppressed with |ignore-err=yes when target cannot be found because target is inside<br />
a template that wraps another template; 'multiple targets' error may not be suppressed<br />
<br />
]]<br />
<br />
local function target_check (anchor_id, args)<br />
local namespace = mw.title.getCurrentTitle().namespace;<br />
local anchor_id_list_module = mw.loadData ('Module:Footnotes/anchor_id_list');<br />
local anchor_id_list = anchor_id_list_module.anchor_id_list;<br />
local article_whitelist = anchor_id_list_module.article_whitelist;<br />
local template_list = anchor_id_list_module.template_list;<br />
<br />
local whitelist_module = mw.loadData ('Module:Footnotes/whitelist');<br />
local whitelist = whitelist_module.whitelist;<br />
local special_patterns = whitelist_module.special_patterns;<br />
local DNB_special_patterns = whitelist_module.DNB_special_patterns;<br />
local DNB_template_names = whitelist_module.DNB_template_names;<br />
<br />
if 10 == namespace then<br />
return ''; -- automatic form of |template-doc-demo=true; TODO: is this too broad?<br />
end<br />
<br />
local tally = anchor_id_list[anchor_id]; -- nil when anchor_id not in list; else a tally<br />
local msg;<br />
local category;<br />
<br />
if not tally then<br />
if args.ignore then<br />
return ''; -- if ignore is true then no message, no category<br />
end<br />
<br />
if article_whitelist and article_whitelist[anchor_id] then -- if an article-local whitelist and anchor ID is in it<br />
return ''; -- done<br />
end<br />
<br />
local wl_anchor_id = anchor_id; -- copy to be modified to index into the whitelist<br />
<br />
if args.year then -- for anchor IDs created by this template (not in |ref=) that have a date<br />
if args.year:match ('%d%l$') or -- use the date value to determine if we should remove the disambiguator<br />
args.year:match ('n%.d%.%l$') or<br />
args.year:match ('nd%l$') then<br />
wl_anchor_id = wl_anchor_id:gsub ('%l$', ''); -- remove the disambiguator<br />
end<br />
end <br />
<br />
local t_tbl = whitelist[wl_anchor_id]; -- get list of templates associated with this anchor ID<br />
<br />
if t_tbl then -- when anchor ID not whitelisted t_tbl is nil<br />
for _, t in ipairs (t_tbl) do -- spin through the list of templates associated with this anchor ID<br />
if template_list[t] then -- if associated template is found in the list of templates in the article<br />
return ''; -- anchor ID is whitlisted and article has matching template so no error<br />
end<br />
end<br />
end<br />
<br />
for _, pattern in ipairs (special_patterns) do -- spin through the spcial patterns and try to match<br />
if anchor_id:match (pattern) then<br />
return '';<br />
end<br />
end<br />
<br />
for _, dnb_t in ipairs (DNB_template_names or {}) do -- getting desparate now, are there any DNB templates? DNB_template_names may be nil; empty table prevents script error<br />
if template_list[dnb_t] then -- if the article has this DNB template<br />
for _, pattern in ipairs (DNB_special_patterns) do -- spin through the DNB-specifiec wildcard patterns<br />
if anchor_id:match (pattern) then -- and attempt a match<br />
return ''; -- found a match<br />
end<br />
end<br />
end<br />
end<br />
<br />
msg = 'no target: ' .. anchor_id; -- anchor_id not found<br />
category = '[[Category:Harv and Sfn no-target errors]]';<br />
<br />
elseif 1 < tally then<br />
msg = 'multiple targets (' .. tally .. '×): ' .. anchor_id; -- more than one anchor_id in this article<br />
category = '[[Category:Harv and Sfn multiple-target errors]]';<br />
end<br />
<br />
-- category = 0 == namespace and '[[Category:Harv and Sfn template errors]]' or ''; -- only categorize in article space<br />
category = 0 == namespace and category or ''; -- only categorize in article space<br />
<br />
--use this version to show error messages<br />
-- return msg and '<span class="error harv-error" style="display: inline; font-size:100%"> ' .. args.template .. ' error: ' .. msg .. ' ([[:Category:Harv and Sfn template errors|help]])</span>' .. category or '';<br />
--use this version to hide error messages<br />
return msg and '<span class="error harv-error" style="display: none; font-size:100%"> ' .. args.template .. ' error: ' .. msg .. ' ([[:Category:Harv and Sfn template errors|help]])</span>' .. category or '';<br />
<br />
end<br />
<br />
<br />
--[[--------------------------< I S _ Y E A R >----------------------------------------------------------------<br />
<br />
evaluates param to see if it is one of these forms with or without lowercase letter disambiguator:<br />
YYYY<br />
n.d.<br />
nd <br />
c. YYYY<br />
YYYY–YYYY (separator is endash)<br />
YYYY–YY (separator is endash)<br />
<br />
return true when param has a recognized form; false else<br />
<br />
]]<br />
<br />
local patterns_date= {<br />
'^%d%d%d%d?%l?$',<br />
'^n%.d%.%l?$',<br />
'^nd%l?$',<br />
'^c%. %d%d%d%d?%l?$',<br />
'^%d%d%d%d–%d%d%d%d%l?$',<br />
'^%d%d%d%d–%d%d%l?$',<br />
}<br />
<br />
local function is_year (param, args)<br />
args.year = ''; -- used for harv error; <br />
<br />
for _, pattern in ipairs (patterns_date) do<br />
if mw.ustring.match (param, pattern) then<br />
args.year = param; -- used for harv error; <br />
return true;<br />
end<br />
end<br />
end<br />
<br />
<br />
--[[--------------------------< C O R E >----------------------------------------------------------------------<br />
<br />
returns an anchor link (CITEREF) formed from one to four author names, year, and insource location (|p=, |pp=, loc=)<br />
<br />
]]<br />
<br />
local function core( args )<br />
local result;<br />
local err_msg = ''<br />
<br />
if args.P5 ~= '' then<br />
if is_year (args.P5, args) then<br />
result = table.concat ({args.P1, ' et al. ', args.bracket_year_left, args.P5, args.bracket_year_right});<br />
else<br />
args.P5 = ''; -- when P5 not a year don't include in anchor<br />
result = table.concat ({args.P1, ' et al.'}); -- and don't render it<br />
end<br />
<br />
elseif args.P4 ~= '' then<br />
if is_year (args.P4, args) then<br />
result = table.concat ({args.P1, ', ', args.P2, ' &amp; ', args.P3, ' ', args.bracket_year_left, args.P4, args.bracket_year_right}); -- three names and a year<br />
else<br />
result = table.concat ({args.P1, ' et al.'}); -- four names<br />
end<br />
<br />
elseif args.P3 ~= '' then<br />
if is_year (args.P3, args) then<br />
result = table.concat ({args.P1, ' &amp; ', args.P2, ' ', args.bracket_year_left, args.P3, args.bracket_year_right}); -- two names and a year<br />
else<br />
result = table.concat ({args.P1, ', ', args.P2, ' ', ' &amp; ', args.P3}); -- three names<br />
end<br />
<br />
elseif args.P2 ~= '' then<br />
if is_year (args.P2, args) then<br />
result = table.concat ({args.P1, ' ', args.bracket_year_left, args.P2, args.bracket_year_right}); -- one name and year<br />
else<br />
result = table.concat ({args.P1, ' &amp; ', args.P2}); -- two names<br />
end<br />
<br />
else<br />
result = args.P1; -- one name<br />
end<br />
-- when author-date result ends with a dot (typically when the last positional parameter holds 'n.d.')<br />
-- and when no in-source location (no |p=, |pp=, or |loc=)<br />
-- and when the first or only character in args.postscript is a dot<br />
-- remove the author-date result trailing dot<br />
-- the author-date result trailing dot will be replaced later with the content of args.postscript (usually a dot)<br />
if ('.' == result:sub(-1)) and ('.' == args.postscript:sub(1)) and ('' == args.page) and ('' == args.pages) and ('' == args.location) then<br />
result = result:gsub ('%.$', '');<br />
end<br />
<br />
if args.ref ~= 'none' then<br />
local anchor_id;<br />
if args.ref ~= '' then<br />
anchor_id = mw.uri.anchorEncode (args.ref);<br />
err_msg = target_check (anchor_id, args);<br />
result = table.concat ({'[[#', anchor_id, '|', result, ']]'});<br />
else<br />
anchor_id = mw.uri.anchorEncode (table.concat ({'CITEREF', args.P1, args.P2, args.P3, args.P4, args.P5}));<br />
err_msg = target_check (anchor_id, args);<br />
result = table.concat ({'[[#', anchor_id, '|', result, ']]'});<br />
end<br />
end<br />
<br />
if args.page ~= '' then<br />
result = table.concat ({result, args.page_sep, args.page});<br />
elseif args.pages ~= ''then<br />
result = table.concat ({result, args.pages_sep, args.pages});<br />
end <br />
<br />
if args.location ~= '' then<br />
result = table.concat ({result, ', ', args.location});<br />
end<br />
<br />
result = table.concat ({args.bracket_left, result, args.bracket_right, args.postscript}):gsub ('%s+', ' '); -- strip redundant spaces<br />
return result .. err_msg;<br />
end<br />
<br />
<br />
--[[--------------------------< A R G S _ F E T C H >---------------------------------------------------------<br />
<br />
Because all of the templates share a common set of parameters, a single common function to fetch those parameters<br />
from frame and parent frame.<br />
<br />
]]<br />
<br />
local function args_fetch (frame, ps)<br />
local args = args_default; -- create a copy of the default table<br />
local pframe = frame:getParent(); -- point to the template's parameter table<br />
<br />
for k, v in pairs (frame.args) do -- override defaults with values provided in the #invoke: if any<br />
args[k] = v; <br />
end<br />
<br />
args.postscript = pframe.args.postscript or pframe.args.ps or ps;<br />
if 'none' == args.postscript then<br />
args.postscript = '';<br />
end<br />
args.page = pframe.args.p or pframe.args.page or '';<br />
args.pages = pframe.args.pp or pframe.args.pages or '';<br />
args.location = pframe.args.loc or '';<br />
args.ref = pframe.args.ref or pframe.args.Ref or '';<br />
args.ignore = ('yes' == pframe.args['ignore-false-positive']) or ('yes' == pframe.args['ignore-err']);<br />
<br />
for i, v in ipairs ({'P1', 'P2', 'P3', 'P4', 'P5'}) do -- loop through the five positional parameters and trim if set else empty string<br />
args[v] = (pframe.args[i] and mw.text.trim (pframe.args[i])) or '';<br />
end<br />
<br />
if args.P5 and not is_year (args.P5, args) then<br />
local i = 6; -- initialize the indexer to the sixth positional parameter<br />
while pframe.args[i] do -- in case there are too many authors loop through the authors looking for a year<br />
local v = mw.text.trim (pframe.args[i]); -- trim<br />
if is_year (v, args) then -- if a year<br />
args.P5 = v; -- overwrite whatever was in args.P5 with year<br />
break; -- and abandon the search<br />
end<br />
i = i + 1; -- bump the indexer<br />
end<br />
end<br />
return args;<br />
end<br />
<br />
<br />
--[[--------------------------< H A R V A R D _ C I T A T I O N >----------------------------------------------<br />
<br />
common entry point for:<br />
{{harvard citation}} aka {{harv}}<br />
{{Harvard citation no brackets}} aka {{harvnb}}<br />
{{harvcol}}<br />
{{harvcolnb}}<br />
{{harvcoltxt}}<br />
{{Harvard citation text}} aka {{harvtxt}}<br />
{{Harvp}}<br />
<br />
Distinguishing features (brackets and page separators) are specified in this module's {{#invoke}} in the respective templates.<br />
<br />
]]<br />
<br />
local function harvard_citation (frame)<br />
local args = args_fetch (frame, ''); -- get the template and invoke parameters; default postscript is empty string<br />
<br />
return core (args);<br />
end<br />
<br />
<br />
--[[--------------------------< S T R I P _ U R L >------------------------------------------------------------<br />
<br />
used by sfn() and sfnm(). This function fixes an issue with reference tooltip gadget where the tooltip is not displayed<br />
when an insource locator (|p=, |pp=, |loc=) has an external wikilink that contains a # character<br />
<br />
strip uri-reserved characters from urls in |p=, |pp-, and |loc= parameters The researved characters are:<br />
!#$&'()*+,/:;=?@[]<br />
<br />
]]<br />
<br />
local function strip_url (pages)<br />
local escaped_uri;<br />
if not pages or ('' == pages) then<br />
return pages;<br />
end<br />
<br />
for uri in pages:gmatch ('%[(%a[%w%+%.%-]*://%S+)') do -- for each external link get the uri<br />
escaped_uri = uri:gsub ("([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" ); -- save a copy with lua pattern characters escaped<br />
uri = uri:gsub ("[!#%$&'%(%)%*%+,/:;=%?@%[%]%.%%]", ''); -- remove reserved characters and '%' because '%20' (space character) is a lua 'invalid capture index'<br />
pages = pages:gsub (escaped_uri, uri, 1); -- replace original uri with the stripped version<br />
end<br />
<br />
return pages;<br />
end<br />
<br />
<br />
--[[--------------------------< S F N >------------------------------------------------------------------------<br />
<br />
entry point for {{sfn}} and {{sfnp}}<br />
<br />
]]<br />
<br />
local function sfn (frame)<br />
local args = args_fetch (frame, '.'); -- get the template and invoke parameters; default postscript is a dot<br />
<br />
local result = core (args); -- go make a CITEREF anchor<br />
-- put it all together and then strip redundant spaces<br />
local name = table.concat ({'FOOTNOTE', args.P1, args.P2, args.P3, args.P4, args.P5, strip_url (args.page), strip_url (args.pages), strip_url (args.location)}):gsub ('%s+', ' ');<br />
<br />
return frame:extensionTag ({name='ref', args={name=name}, content=result}); <br />
<br />
<br />
end<br />
<br />
<br />
--[[--------------------------< S F N M >----------------------------------------------------------------------<br />
<br />
common entry point for {{sfnm}} and {{sfnmp}}<br />
<br />
Distinguishing features (brackets) are specified in this module's {{#invoke}} in the respective templates.<br />
<br />
]]<br />
<br />
local function sfnm (frame)<br />
local args = args_default; -- create a copy of the default table<br />
local pframe = frame:getParent(); -- point to the template's parameter table<br />
<br />
local n = 1; -- index of source; this is the 'n' in na1, ny, etc<br />
local first_pnum = 1; -- first of a pair of positional parameters<br />
local second_pnum = 2; -- second of a pair of positional parameters<br />
<br />
local last_ps = 0; -- index of the last source with |nps= set<br />
local last_index = 0; -- index of the last source; these used to determine which of |ps= or |nps= will terminate the whole rendering<br />
<br />
local out = {}; -- table to hold rendered sources<br />
local footnote = {'FOOTNOTE'}; -- all author, date, insource location stuff becomes part of the reference's footnote id; added as we go<br />
<br />
for k, v in pairs (frame.args) do -- override defaults with values provided in the #invoke: if any<br />
args[k] = v; <br />
end<br />
<br />
while true do<br />
if not pframe.args[table.concat ({n, 'a1'})] and not pframe.args[first_pnum] then<br />
break; -- no na1 or matching positional parameter so done<br />
end<br />
<br />
if pframe.args[table.concat ({n, 'a1'})] then -- does this source use named parameters?<br />
for _, v in ipairs ({'P1', 'P2', 'P3', 'P4', 'P5'}) do -- initialize for this source<br />
args[v] = '';<br />
end<br />
<br />
for i, v in ipairs ({'P1', 'P2', 'P3', 'P4', 'P5'}) do -- extract author and year parameters for this source<br />
args[v] = pframe.args[table.concat ({n, 'a', i})] or ''; -- attempt to assign author name<br />
if '' == args[v] then -- when there wasn't an author name<br />
args[v] = pframe.args[table.concat ({n, 'y'})] or ''; -- attempt to assign year<br />
break; -- done with author/date for this source<br />
end<br />
end<br />
<br />
else -- this source uses positional parameters<br />
args.P1 = mw.text.trim (pframe.args[first_pnum]); -- yes, only one author supported<br />
args.P2 = (pframe.args[second_pnum] and mw.text.trim (pframe.args[second_pnum])) or ''; -- when positional author, year must also be positional<br />
<br />
for _, v in ipairs ({'P3', 'P4', 'P5'}) do -- blank the rest of these for this source<br />
args[v] = '';<br />
end<br />
<br />
first_pnum = first_pnum + 2; -- source must use positional author and positional year<br />
second_pnum = first_pnum + 1; -- bump these for possible next positional source<br />
end<br />
<br />
args.postscript = pframe.args[table.concat ({n, 'ps'})] or '';<br />
if 'none' == args.postscript then -- this for compatibility with other footnote templates; does nothing<br />
args.postscript = '';<br />
end<br />
<br />
args.ref = pframe.args[table.concat ({n, 'ref'})] or ''; -- alternate reference for this source<br />
<br />
args.page = pframe.args[table.concat ({n, 'p'})] or ''; -- insource locations for this source<br />
args.pages = pframe.args[table.concat ({n, 'pp'})] or '';<br />
args.location = pframe.args[table.concat ({n, 'loc'})] or '';<br />
args.ignore = ('yes' == pframe.args[table.concat ({n, 'ignore-false-positive'})]) or ('yes' == pframe.args[table.concat ({n, 'ignore-err'})]);<br />
-- args.ignore = 'yes' == pframe.args[table.concat ({n, 'ignore-err'})];<br />
<br />
table.insert (out, core (args)); -- save the rendering of this source<br />
<br />
for k, v in ipairs ({'P1', 'P2', 'P3', 'P4', 'P5'}) do -- create the FOOTNOTE id<br />
if '' ~= args[v] then<br />
table.insert (footnote, args[v]);<br />
end<br />
end<br />
for k, v in ipairs ({'page', 'pages', 'location'}) do -- these done separately so that we can strip uri-reserved characters from extlinked page numbers <br />
if '' ~= args[v] then<br />
table.insert (footnote, strip_url (args[v]))<br />
end<br />
end<br />
<br />
last_index = n; -- flags used to select terminal postscript from nps or from end_ps<br />
if '' ~= args.postscript then <br />
last_ps = n;<br />
end<br />
<br />
n = n+1; -- bump for the next one<br />
end<br />
<br />
local name = table.concat (footnote):gsub ('%s+', ' '); -- put the footnote together and strip redundant space<br />
<br />
args.end_ps = pframe.args.postscript or pframe.args.ps or '.'; -- this is the postscript for the whole not for the individual sources<br />
if 'none' == args.end_ps then -- not an original sfnm parameter value; added for compatibility with other footnote templates<br />
args.end_ps = '';<br />
end<br />
<br />
local result = table.concat ({table.concat (out, '; '), (last_index == last_ps) and '' or args.end_ps});<br />
return frame:extensionTag ({name='ref', args={name=name}, content=result});<br />
end<br />
<br />
<br />
--[[--------------------------< S F N R E F >------------------------------------------------------------------<br />
<br />
implements {{sfnref}}<br />
<br />
]]<br />
<br />
local function sfnref (frame)<br />
local args = getArgs (frame);<br />
local out = {};<br />
<br />
for i=1, 5 do -- get the first five args if there are five args<br />
if args[i] then<br />
out[i] = args[i];<br />
else<br />
break; -- less than 5 args break out<br />
end<br />
end<br />
<br />
if 5 == #out then -- when we have seen five args there may bemore<br />
local i = 6; -- initialize the indexer to the sixth positional parameter<br />
while args[i] do -- in case there are too many authors loop through the authors looking for a year<br />
if is_year (args[i], args) then -- if a year<br />
out[5] = args[i]; -- overwrite whatever was in args[5] with year<br />
break; -- and abandon the search<br />
end<br />
i = i + 1; -- bump the indexer<br />
end<br />
end<br />
<br />
return mw.uri.anchorEncode ('CITEREF' .. table.concat (out));<br />
end<br />
<br />
<br />
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------<br />
]]<br />
<br />
return {<br />
harvard_citation = harvard_citation,<br />
sfn = sfn,<br />
sfnm = sfnm,<br />
sfnref = sfnref,<br />
};</div>
en>Trappist the monk