Vorlage:ParseTextValue4ical: Unterschied zwischen den Versionen

Aus Bayernflora
Wechseln zu: Navigation, Suche
K (DEBUG)
K (CRLF TEst)
 
(8 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 8: Zeile 8:
 
; 1= : the text value
 
; 1= : the text value
 
</div>
 
</div>
 
 
  
 
<pre>
 
<pre>
Zeile 15: Zeile 13:
  
 
next line goes here
 
next line goes here
}}
+
and here it goes further
 +
a line very long text very long text very long text very long text very long text}}
 
</pre>
 
</pre>
  
{{ParseTextValue4ical|1=very long text very long text very long text very long text very long text very long text  
+
{{ParseTextValue4ical|1=very long text very long text very long text very long text very long text very long text  
  
 
next line goes here
 
next line goes here
}}
+
and here it goes further
 +
a line very long text very long text very long text very long text very long text}}
  
 
[[{{ns:category}}:{{#switch: {{CONTENTLANGUAGE}}<!--
 
[[{{ns:category}}:{{#switch: {{CONTENTLANGUAGE}}<!--
Zeile 40: Zeile 40:
 
       -->{{#replace:<!--  
 
       -->{{#replace:<!--  
 
         -->{{#replace:<!--  
 
         -->{{#replace:<!--  
           -->{{{1|}}}<!--  
+
           -->{{#replace:<!--
        -->|\|\\}}<!--  
+
            -->{{{1|}}}<!--  
      -->|<nowiki></nowiki>
+
          -->|\|\\}}<!--  
<nowiki></nowiki>|\n}}<!--  
+
        -->|<nowiki></nowiki>
    -->|,|\,}}<!--  
+
<nowiki></nowiki>|\n}}<!--
  -->|;|\;}}<!--  
+
      -->|,|\,}}<!--  
 +
    -->|;|\;}}<!--
 +
  -->|:|\:}}<!--  
 
  -->}}<!--  
 
  -->}}<!--  
 
  -->{{#vardefine: textLength |{{#len: {{#var: text }}}}}}<!--  
 
  -->{{#vardefine: textLength |{{#len: {{#var: text }}}}}}<!--  
Zeile 58: Zeile 60:
 
   -->|§<!-- assign temporary var
 
   -->|§<!-- assign temporary var
 
   -->|<!--  
 
   -->|<!--  
   -->i: {{#var: i-loop}}, #sub: 0 {{!}} {{#expr: {{#var: i-loop}} * {{#var: textBreakLength}} }}<br/>{{#var: textWrapped}}<br/><!--
+
   -->{{#vardefine: textWrapped |<!--  
-->{{#vardefine: textWrapped |<!--  
+
     -->{{#sub: {{#ifeq: {{#var: i-loop}} | 1 |{{#var: text}}|{{#var: textWrapped}}}}| 0 | {{#expr: {{#var: i-loop}} * {{#var: textBreakLength}} }} }}<!--  
     -->{{#sub: {{#ifeq: | {{#var: i-loop}} | 1 |{{#var: text}}|{{#var: textWrapped}}}}| 0 | {{#expr: {{#var: i-loop}} * {{#var: textBreakLength}} }} }}<!--  
+
  CRLF needed here!!!
     --><nowiki></nowiki>
+
     -->
 
+
<nowiki></nowiki><!--  
<nowiki></nowiki> <nowiki></nowiki><!--  
+
     -->{{#sub: {{#ifeq: {{#var: i-loop}} | 1 |{{#var: text}}|{{#var: textWrapped}}}}| {{#expr: {{#var: i-loop}} * {{#var: textBreakLength}} }} }}<!--  
     -->{{#sub: {{#ifeq: | {{#var: i-loop}} | 1 |{{#var: text}}|{{#var: textWrapped}}}}| {{#expr: {{#var: i-loop}} * {{#var: textBreakLength}} }} }}<!--  
+
   -->}}<!-- vardefine: textWrapped
   -->}}<!--  
+
  
 
     reset i-loop
 
     reset i-loop
Zeile 72: Zeile 73:
 
   -->|<!--output sep
 
   -->|<!--output sep
 
   -->}}<!-- end arraymap  
 
   -->}}<!-- end arraymap  
   -->{{#var: textWrapped}}<!-- text output
+
   -->{{#replace:{{#var: textWrapped}}|\:|:}}<!-- text output
  
else-->|{{#var: text}}<!-- text output
+
else-->|{{#replace:{{#var: text}}|\:|:}}<!-- text output
 
-->}}<!-- end if
 
-->}}<!-- end if
 
   
 
   
-->
+
--></includeonly>
 
+
DEBUG {{#var: textWrapped}}
+
 
+
 
+
</includeonly>
+

Aktuelle Version vom 20. Januar 2014, 15:57 Uhr

Following transformation will be done:

  • wrap text to 75 and indent it by 1 space
  • escape: \, \; \n

Parameters

1= 
the text value
{{ParseTextValue4ical|1=very long text very long text very long text very long text very long text very long text 

next line goes here
and here it goes further
a line very long text very long text very long text very long text very long text}}
very long text very long text very long text very long text very long text
 very long text \n\nnext line goes here\nand here it goes further\na lin
e very long text very long text very long text very long text very long 
text