Module:Strip to numbers/testcases
From Wikipedia, the free encyclopedia
Page Module:Message box/ombox.css has no content.
| This is the template test cases page for the sandbox of Module:Strip to numbers. 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 and parsers with these links: |
Strip units from CSS values (why I want this)
- Input:
-12em, 34px, 56.7%, "89", 0 - Result: Script error: No such module "StripToNumbers".
- Input (will choke because of multiple
.characters:-12em, 34px, 56.7%, "8.9", 0 - Result: Script error: No such module "StripToNumbers".
- Input (will choke because of multiple
-characters:-12em, 34px, 57%, "-8.9", 0 - Result: Script error: No such module "StripToNumbers".
- Input:
inherit - Result: Script error: No such module "StripToNumbers".
Find numbers in a bunch of stuff
- Input:
SDks]df9s>dfjklasdfk9kasdfkasdkie0kmc'@(aks - Result: Script error: No such module "StripToNumbers".
- Input:
"12.3x4" - Result: Script error: No such module "StripToNumbers".
Halve number found in stuff
- Input:
foobarbaz50%blahblahblah - Result: Script error: No such module "StripToNumbers".
- Input:
-66.6666666666666666666666666666 - Result: Script error: No such module "StripToNumbers".
- Input:
chickenbutt - Result: Script error: No such module "StripToNumbers".
Nastier input tests
- Input:
style="font-size: 70% ;" - Result: Script error: No such module "StripToNumbers".
- Input:
'style="font-size: 70% ;"' - Result: Script error: No such module "StripToNumbers".
- Input:
`style="font-size: 70% ;"` - Result: Script error: No such module "StripToNumbers".
- Input:
=70% - Result: Script error: No such module "StripToNumbers".
Yeah, it dies on contact with =. Can it be escaped? (see below: use |1=)
- Input:
{{=}}70% - Result: Script error: No such module "StripToNumbers".
- Input:
style{{=}}"font-size: 70% ;" - Result: Script error: No such module "StripToNumbers".
- Input:
<span style{{=}}"font-size: 70%;"> - Result: Script error: No such module "StripToNumbers".
- Input:
<span style<nowiki>=</nowiki>"font-size: 70%;"> - Result: Script error: No such module "StripToNumbers".
Yes, though only with Template:Tlx; it chokes on <nowiki>...</nowiki>. Though this points out the relative uselessness of trying to use this on strings this complicated, since -70 is the opposite of the desired output, 70. It needs to be able to discern with - is directly associated with a numeral (or perhaps a ., since while -.7 is crappy style, it's still a technically valid way to write -0.7.
Try: |1=
- Input:
1=70% - Result: Script error: No such module "StripToNumbers".
- Input:
<span class="nowrap"><span data-sort-value="7001123000000000000♠"></span>12.3</span>(produced by {{val|12.3}}) - Result: Script error: No such module "StripToNumbers".
After upgrade to match more narrowly
- Input:
style{{=}}"margin-left: 10% ;" - Result: Script error: No such module "StripToNumbers".
- Input:
style{{=}}"margin-left: -10% ;" - Result: Script error: No such module "StripToNumbers".
- Input:
Weasels - 12. Chickens - 72. - Result: Script error: No such module "StripToNumbers".