Template:Val: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
meta>Cpiral Remove recently added noinclude tags to restore readability. |
meta>Cpiral START UNITS: refactored String module calls, plus nbsp is added here instead of val/units |
||
| Line 81: | Line 81: | ||
| | | | ||
{{#if:{{{u|}}} | {{#if:{{{u|}}} | ||
| | | <!-- if u= has any multiplier or divider symbols --> | ||
{{#ifexpr:{{#invoke:String|find|source={{{u}}}|target=[./*]|plain=false}} | {{#ifexpr:{{#invoke:String|find|source={{{u}}}|target=[./*]|plain=false}} | ||
| | | | ||
{{#invoke:String|replace | {{#invoke:String|replace | ||
|source = | |source = | ||
{{#invoke:String|replace | |||
|source = | |||
{{#invoke:String|match | |||
|s = {{Val/units|{{{u}}}}} | |||
|replace = ( | <!-- from "what is not [ or |" up to: where next char is ] --> | ||
|pattern = [^%[{{!}}]+%f[%]] | |||
|ignore_errors = true | |||
|pattern = | }} | ||
|pattern = ^ | |||
|replace = ( | |||
|plain = false | |||
}} | |||
|pattern = $ | |||
|replace = ) | |replace = ) | ||
|plain = false | |||
}} | }} | ||
| <!-- Same thing, but without replace with parentheses --> | | <!-- Same thing, but without replace with parentheses --> | ||
{{#invoke:String| | {{#invoke:String|match | ||
| | |s = {{Val/units|{{{u}}}}} | ||
|pattern = [^%[{{!}}]+%f[%]] | |||
|ignore_errors = true | |||
| | |||
}} | }} | ||
}} | }} | ||
| Line 112: | Line 112: | ||
-->{{#if:{{{ul|}}} <!-- With up/upl its possible to have neither u nor ul.--> | -->{{#if:{{{ul|}}} <!-- With up/upl its possible to have neither u nor ul.--> | ||
| | | | ||
{{#ifexpr:{{#invoke:String|find|source={{{ul}}}|target=[./*]|plain=false}} | {{#ifexpr:{{#invoke:String|find|source={{{ul}}}|target=[./*]|plain=false}} | ||
| <!-- Grouping parentheses --> | | <!-- Grouping parentheses --> | ||
{{#invoke:String|replace | {{#invoke:String|replace | ||
| Line 118: | Line 118: | ||
{{#invoke:String|replace | {{#invoke:String|replace | ||
|source = {{Val/units|{{{ul}}}|ls={{{long scale}}}}} | |source = {{Val/units|{{{ul}}}|ls={{{long scale}}}}} | ||
|pattern = | |pattern = ^ | ||
|replace = ( | |replace = ( | ||
| | |plain = false | ||
|ignore_errors = true | |||
}} | }} | ||
|pattern = | |pattern = $ | ||
|replace = | |replace = ) | ||
|plain = false | |plain = false | ||
}} | }} | ||
| <!-- normal call --> | | <!-- normal call --> | ||
| Line 137: | Line 138: | ||
|source = | |source = | ||
{{#invoke:String|replace | {{#invoke:String|replace | ||
|source = {{Val/units|{{{up}}}}} | |source = | ||
{{#invoke:String|match | |||
|s = {{Val/units|{{{up}}}}} | |||
|pattern = [^%[{{!}}]+%f[%]] | |||
|ignore_errors = true | |||
}} | |||
|pattern = ^ | |||
|replace = /( | |replace = /( | ||
|plain = false | |plain = false | ||
}} | }} | ||
|pattern = | |pattern = $ | ||
|replace = ) | |replace = ) | ||
|plain = false | |||
}} | }} | ||
| <!-- Same thing, but without replace with parentheses --> | | <!-- Same thing, but without replace with parentheses --> | ||
{{#invoke:String|replace | {{#invoke:String|replace | ||
|source = | |source = | ||
{{#invoke:String| | {{#invoke:String|match | ||
| | |s = {{Val/units|{{{up}}}}} | ||
|pattern = | |pattern = [^%[{{!}}]+%f[%]] | ||
| | |ignore_errors = true | ||
}} | }} | ||
|pattern = | |pattern = ^ | ||
|replace = | |replace = / | ||
|plain = false | |||
}} | }} | ||
}} | }} | ||
| Line 165: | Line 172: | ||
{{#invoke:String|replace | {{#invoke:String|replace | ||
|source = {{Val/units|{{{upl}}}}} | |source = {{Val/units|{{{upl}}}}} | ||
|pattern = | |pattern = ^ | ||
|replace = /( | |replace = /( | ||
|plain = false | |plain = false | ||
| | |ignore_errors = true | ||
}} | }} | ||
|pattern = | |pattern = $ | ||
|replace = | |replace = ) | ||
|plain = false | |plain = false | ||
}} | }} | ||
| Line 177: | Line 184: | ||
{{#invoke:String|replace | {{#invoke:String|replace | ||
|source = {{val/units|{{{upl}}}}} | |source = {{val/units|{{{upl}}}}} | ||
|pattern = | |pattern = ^ | ||
|replace = / | |replace = / | ||
|plain = false | |plain = false | ||
| | |ignore_errors = true | ||
}} | }} | ||
}} | }} | ||
| Line 187: | Line 194: | ||
{{#if:{{{u|}}} | {{#if:{{{u|}}} | ||
| | | | ||
{{#invoke:String| | {{#invoke:String|match | ||
| | |s = {{val/units|{{{u}}}}} | ||
|pattern = [^%[{{!}}]+%f[%]] | |||
|ignore_errors = true | |||
| | |||
}} | }} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ul|}}} | -->{{#if:{{{ul|}}} | ||
|{{val/units|{{{ul}}}|ls = {{{long scale}}}}} | | {{val/units|{{{ul}}}|ls = {{{long scale}}}}} | ||
}} | }} | ||
}}<!-- end up/upl | |||
END UNITS | END UNITS | ||
Revision as of 10:29, 6 June 2015
Lua error in Module:Documentation at line 7: Module:Documentation/config returned boolean, table expected.