टेम्पलेट:Val: रिवीजन सभ के बीचा में अंतर
Content deleted Content added
imported>Headbomb |
imported>Cpiral New START UNITS section |
||
लाइन 78:
START UNITS
-->{{#if:{{{up|}}}{{{upl|}}}
|
{{#if:{{{u|}}}
|
{{#ifexpr:{{#invoke:String|find|source={{{u}}}|target=[./*]|plain=false}}
|
{{#invoke:String|replace
|source =
{{#invoke:String|replace
<!-- [[title|markup]]: & (or [) is 1st, [ is 7th (or 1st)-->
|source = {{Val/units/sandbox|{{{u}}}}}
|pattern = %[%[.+{{!}} <!--keeps , but compare others -->
|replace = (
|plain = false
}}
|pattern = ]]
|replace = )
}}
| <!-- Same thing, but without replace with parentheses -->
{{#invoke:String|replace
|source =
{{#invoke:String|replace
|source = {{Val/units/sandbox|{{{u}}}}}
|pattern = %[%[.+{{!}}
|replace =
|plain = false
}}
|pattern = ]]
|replace =
}}
}}
}}<!-- end up/upl AND u
-->{{#if:{{{ul|}}} <!-- With up/upl its possible to have neither u nor ul.-->
|
{{#ifexpr:{{#invoke:String|find|source={{{ul}}}|target=[./*]|plain=false}}
| <!-- Grouping parentheses -->
{{#invoke:String|replace
|source =
{{#invoke:String|replace
|source = {{Val/units/sandbox|{{{ul}}}|ls={{{long scale}}}}}
|pattern = [ <!-- keep spacing -->
|replace = ([
|count = 1
}}
|pattern = %]%]
|replace = ]])
|plain = false <!-- using %]%], not ]], prevents code mangle -->
}}
| <!-- normal call -->
{{val/units/sandbox|{{{ul}}}|ls = {{{long scale}}}}}
}}
}}<!-- End up/upl AND ul
-->{{#if:{{{up|}}}
|
{{#ifexpr:{{#invoke:String|find|source={{{up}}}|target=[./*]|plain=false}}
|
{{#invoke:String|replace
|source =
{{#invoke:String|replace
|source = {{Val/units/sandbox|{{{up}}}}}
|pattern = .*%[%[.+{{!}} <!-- remove spacing -->
|replace = /(
|plain = false
}}
|pattern = ]]
|replace = )
}}
| <!-- Same thing, but without replace with parentheses -->
{{#invoke:String|replace
|source =
{{#invoke:String|replace
|source = {{Val/units/sandbox|{{{up}}}}}
|pattern = .*%[%[.+{{!}}
|replace = /
|plain = false
}}
|pattern = ]]
|replace =
}}
}}
| <!-- upl -->
{{#ifexpr:{{#invoke:String|find|source={{{upl}}}|target=[./*]|plain=false}}
|
{{#invoke:String|replace
|source =
{{#invoke:String|replace
|source = {{Val/units/sandbox|{{{upl}}}}}
|pattern = .-%[ <!-- remove spacing -->
|replace = /([
|plain = false
|count = 1
}}
|pattern = %]%]
|replace = ]])
|plain = false
}}
| <!-- Same thing, but without replace with parentheses -->
{{#invoke:String|replace
|source = {{val/units/sandbox|{{{upl}}}}}
|pattern = .-%[ <!-- remove spacing: PCRE is .*?[ -->
|replace = /[
|plain = false
|count = 1
}}
}}
}}
| <!-- No up/upl -->
{{#if:{{{u|}}}
|
{{#invoke:String|replace
|source =
{{#invoke:String|replace
|source = {{val/units/sandbox|{{{u}}}}}
|pattern = %[%[.+{{!}} <!-- keep unit spacing -->
|replace =
|plain = false
}}
|pattern = ]]
|replace =
}}
}}<!--
-->{{#if:{{{ul|}}}
|{{val/units/sandbox|{{{ul}}}|ls = {{{long scale}}}}}
}}
}}<!-- end up/upl
END UNITS
|