Difference between revisions of "Template:PrintFirstParagraph"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 14: Line 14:
 
   -->|<!-- if there are two or more paragraphs
 
   -->|<!-- if there are two or more paragraphs
 
   -->{{#ifexpr: {{#var: varPos}} > 1000<!--
 
   -->{{#ifexpr: {{#var: varPos}} > 1000<!--
     -->|{{#sub: {{{vartext|}}}|0|997}}&#8230;<!--
+
     -->|{{#sub: {{{vartext|}}}|0|997}}<!--
 
     -->|{{#explode_e: {{{vartext|}}}|\n|0}}<!--  
 
     -->|{{#explode_e: {{{vartext|}}}|\n|0}}<!--  
 
   -->}}<!-- ifexpr
 
   -->}}<!-- ifexpr
Line 22: Line 22:
 
   --><!--   
 
   --><!--   
 
   -->{{#ifexpr: {{#var: varLen}} > 1000<!--
 
   -->{{#ifexpr: {{#var: varLen}} > 1000<!--
     -->|{{#sub: {{{vartext|}}}|0|997}}&#8230;<!--
+
     -->|{{#sub: {{{vartext|}}}|0|997}}<!--
 
     -->|{{{vartext|}}}<!--  
 
     -->|{{{vartext|}}}<!--  
 
   -->}}<!-- ifexpr
 
   -->}}<!-- ifexpr
 
-->}}<!-- if
 
-->}}<!-- if
 
--></includeonly>
 
--></includeonly>

Revision as of 00:01, 15 March 2018

This template is used to extract the first paragraph from a given text. If the first paragraph of the text is longer than 1000 characters, only the first 997 characters are returned, and an ellipsis () is added.

NOTE: As any "printing" template, it doesn't store any values anywhere, but merely returns them.

Parameters:

  • |vartext= - the text to extract the first paragraph from.