සැකිල්ල:Plain text/testcases
This is the template test cases page for the sandbox of සැකිල්ල:Plain text. Purge this page to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki, see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins with these links: |
background
සංස්කරණයby -DePiep (talk) 18:15, 3 April 2020 (UTC) Input string has nested span tags. Current Module:Plain text does not handle these as expected. See Template:Plain text/testcases: output is blank.
In Module:Plain text/sandbox I have simply repeated the stripping line :gsub('<span.->(.-)</span>', '%1')
. That works as expected & intended.
Case background: {{Val}} formats compound numbers, and also adds tags like:
{{Val|123.45|7}}
→ 123.45±7<span class="nowrap"><span data-sort-value="7002123450000000000♠"></span>123.45<span style="margin-left:0.3em;margin-right:0.15em;">±</span>7</span>
Nesting the module or template call in-page does not solve it.
I propose to consider implementation of this sandbox trial.
PRoBLEM with sandbox: triple nestings go wrong
Nested spans
සංස්කරණය{{Plain text|1=<span style="background:pink">123.56</span>}}
{{Plain text}}
123.56
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|1=<span class="nowrap"><span style="background:pink">123.56</span></span>}}
{{Plain text}}
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|1=<span class="nowrap"><span data-sort-value="7002123560000000000♠"></span>123.56</span>}}
{{Plain text}}
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|1=<span class="nowrap"><span data-sort-value="7002123450000000000♠"></span>123.45<span style="margin-left:0.3em;margin-right:0.15em;">±</span>7</span>}}
{{Plain text}}
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|1=<span class="nowrap"><span style="background:pink"><span data-sort-value="7002123450000000000♠"></span>123.45<span style="margin-left:0.3em;margin-right:0.15em;">±</span>7</span></span>}}
{{Plain text}}
123.45±7
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|1=<span class="nowrap"><span style="background:pink"><span data-sort-value="7002123450000000000"></span>123.45<span style="margin-left:0.3em;margin-right:0.15em;">±</span>7</span></span>}}
{{Plain text}}
123.45±7
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
nowiki removal
සංස්කරණයOther tests
සංස්කරණය{{Plain text|1=<div><span class="nowrap"><span data-sort-value="7002123560000000000♠"></span>123.56</span></div>}}
{{Plain text}}
123.56
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|1=<span class="nowrap">123.56</span>}}
{{Plain text}}
123.56
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|[[Main Page|Wikipedia's Main Page]]}}
{{Plain text}}
Wikipedia's Main Page
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|[https://en.wikipedia.org External link to wikipedia]}}
{{Plain text}}
https://en.wikipedia.org External link to wikipedia
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
{{Plain text|[[Main page]] | [[Main Page|Wikipedia's Main Page]] | [https://en.wikipedia.org] | [https://en.wikipedia.org External link to wikipedia]}}
{{Plain text}}
Main page | Wikipedia's Main Page | https://en.wikipedia.org | https://en.wikipedia.org External link to wikipedia
අක්ෂර දෝෂය: සැබෑ මොඩියුලක් නොමැත.
References
සංස්කරණය- ^ Reference text