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

Content deleted Content added
imported>Cpiral
Remove recently added noinclude tags to restore readability.
imported>Cpiral
START UNITS: refactored String module calls, plus nbsp is added here instead of val/units
लाइन 81:
|
{{#if:{{{u|}}}
| <!-- if u= has any multiplier or divider symbols -->
|
&nbsp;{{#ifexpr:{{#invoke:String|find|source={{{u}}}|target=[./*]|plain=false}}
|
{{#invoke:String|replace
|source =
{{#invoke:String|replace
|replacesource =
<!--&nbsp;[[title|markup]]: & (or [) is 1st, [ is 7th (or 1st)-->
|source = {{Val/units#invoke:String|{{{u}}}}}match
|patterns = %[%[.+{{!Val/units|{{{u}}}}} <!--keeps &nbsp;, but compare others -->
<!-- from "what is not [ or |" up to: where next char is ] -->
|replace = (
|plainpattern = false[^%[{{!}}]+%f[%]]
}} |ignore_errors = true
|pattern = ]] }}
|pattern = ]]^
|replace = (
|plain = false
}}
|pattern = ]]$
|replace = )
|plain = false
}}
| <!-- Same thing, but without replace with parentheses -->
{{#invoke:String|replacematch
|sources = {{Val/units|{{{u}}}}}
|pattern = [^%[{{#invoke:String|replace!}}]+%f[%]]
|sourceignore_errors = {{Val/units|{{{u}}}}}true
|pattern = %[%[.+{{!}}
|replace =
|plain = false
}}
|pattern = ]]
|replace =
}}
}}
लाइन 112:
-->{{#if:{{{ul|}}} <!-- With up/upl its possible to have neither u nor ul.-->
|
&nbsp;{{#ifexpr:{{#invoke:String|find|source={{{ul}}}|target=[./*]|plain=false}}
| <!-- Grouping parentheses -->
{{#invoke:String|replace
लाइन 118:
{{#invoke:String|replace
|source = {{Val/units|{{{ul}}}|ls={{{long scale}}}}}
|pattern = [ <!-- keep spacing -->^
|replace = ([
|countplain = 1false
|replaceignore_errors = true
}}
|pattern = %]%]$
|replace = ]])
|plain = false <!-- using %]%], not ]], prevents code mangle -->
}}
| <!-- normal call -->
Line 137 ⟶ 138:
|source =
{{#invoke:String|replace
|source = {{Val/units|{{{up}}}}}
|pattern = .*%[%[.+{{!}} <!-- remove spacing -->#invoke:String|match
|s = {{Val/units|{{{up}}}}}
|pattern = [^%[{{!}}]+%f[%]]
|plainignore_errors = falsetrue
}}
|pattern = %[%[.+{{!}}^
|replace = /(
|plain = false
}}
|pattern = ]]$
|replace = )
|replaceplain = false
}}
| <!-- Same thing, but without replace with parentheses -->
{{#invoke:String|replace
|source =
{{#invoke:String|replacematch
|sources = {{Val/units|{{{up}}}}}
|pattern = .*%[^%[.+{{!}}]+%f[%]]
|replaceignore_errors = /true
|plain = false
}}
|pattern = ]]^
|replace = /
|replaceplain = false
}}
}}
Line 165 ⟶ 172:
{{#invoke:String|replace
|source = {{Val/units|{{{upl}}}}}
|pattern = .-%[ <!-- remove spacing -->^
|replace = /([
|plain = false
|countignore_errors = 1true
}}
|pattern = %]%]$
|replace = ]])
|plain = false
}}
Line 177 ⟶ 184:
{{#invoke:String|replace
|source = {{val/units|{{{upl}}}}}
|pattern = .-%[ <!-- remove spacing: PCRE is .*?[ -->^
|replace = /[
|plain = false
|countignore_errors = 1true
}}
}}
Line 187 ⟶ 194:
{{#if:{{{u|}}}
|
&nbsp;{{#invoke:String|replacematch
|sources = {{val/units|{{{u}}}}}
|pattern = [^%[{{#invoke:String|replace!}}]+%f[%]]
|sourceignore_errors = {{val/units|{{{u}}}}}true
|pattern = %[%[.+{{!}} <!-- keep unit spacing -->
|replace =
|plain = false
}}
|pattern = ]]
|replace =
}}
}}<!--
-->{{#if:{{{ul|}}}
|&nbsp;{{val/units|{{{ul}}}|ls = {{{long scale}}}}}
}}
}}<!-- end up/upl
END UNITS