Open main menu

Changes

no edit summary
<noinclude>
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 (<code><nowiki>&#8230;</nowiki></code>) is added.
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely returns them.
</noinclude><includeonly><!--
--><!--
--><!-- exctract only the first 1000 characters
-->{{#vardefine: varTextShort|{{#sub: {{{vartext|}}}|0|1000}}|}}<!--
--><!--
--><!-- check if there is a paragraph sign
-->{{#vardefine: varPos|{{#pos_e: {{{vartext|}#var: varTextShort}}|\n}}|}}<!--
--><!--
-->{{#if: {{#var: varPos}}<!--
-->|<!-- if there are two or more paragraphs
-->{{#ifexprexplode_e: {{#var: varPos}} > 1000<!-- -->|{{#sub: {{{vartext|}}}|0|997}}<!-- -->|{{#explode_e: {{{vartext|}varTextShort}}|\n|0}}<!-- -->}}<!-- ifexpr
-->|<!-- if there is one paragraph or less
-->{{#vardefine: varLen|{{#len: {{#var: varTextShort}} }}|}}<!--
--><!--
-->{{#vardefine: varLen|{{#len: {{{vartext|}}} }}|}}<!-- -->{{#var: varLen}}<!-- -->{{#ifexpr: {{#var: varLen}} > 1000997<!-- -->|greater{{#sub: {{{vartext|}#var: varTextShort}}|0|997}}&#8230;<!-- -->|less{{{vartext|}#var: varTextShort}}<!--
-->}}<!-- ifexpr
-->}}<!-- if
--></includeonly>