टेम्पलेट:Val: रिवीजन सभ के बीचा में अंतर

Content deleted Content added
imported>Headbomb
छो Reverted edits by Headbomb (talk) to last version by Quondum
imported>Cpiral
New START UNITS section
लाइन 78:
 
START UNITS
-->{{#if:{{{up|}}}{{{upl|}}}
 
|
-->{{#if:{{{up|}}}{{{upl|}}}<!--
{{#if:{{{u|}}}
 
|
If there is a up or upl, put brackets around any u or ul with a slash.
{{#ifexpr:{{#invoke:String|find|source={{{u}}}|target=[./*]|plain=false}}
 
|
-->|{{#if:{{{u|}}}|{{val/units|{{{u}}}|nbsp|(|)}}}}<!--
{{#invoke:String|replace
-->{{#if:{{{ul|}}}|{{val/unitswithlink|{{{ul}}}|nbsp|(|)|ls={{{long scale}}}}}}}<!--
|source =
 
{{#invoke:String|replace
Add the slash and after it put brackets around any up or upl with a dot or another slash.
<!--&nbsp;[[title|markup]]: & (or [) is 1st, [ is 7th (or 1st)-->
 
|source = {{Val/units/sandbox|{{{u}}}}}
-->{{#if:{{{up|}}}<!--
|pattern = %[%[.+{{!}} <!--keeps &nbsp;, but compare others -->
-->|{{val/units|{{{up}}}|#47|(|)|(|)}}<!--
|replace = (
-->|{{val/unitswithlink|{{{upl}}}|#47|(|)|(|)|ls={{{long scale}}}}}<!--
|plain = false
-->}}<!--
}}
 
|pattern = ]]
No brackets are needed if there is no up or upl, just add the non-breaking space.
|replace = )
 
}}
-->|{{#if:{{{u|}}}|{{val/units|{{{u}}}|nbsp}}}}<!--
| <!-- Same thing, but without replace with parentheses -->
-->{{#if:{{{ul|}}}|{{val/unitswithlink|{{{ul}}}|nbsp|ls={{{long scale}}}}}}}<!--
{{#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