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 a <code><nowiki>...</nowiki></code> an ellipsis (&#8230;) 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: varPosvarTextShort}} > 1000|\n|0}}<!-- -->{{#sub: {{{vartext|}}}|0|997}}&#201;<!--if there is one paragraph or less -->{{#vardefine: varLen|{{#explode_elen: {{{vartext|#var: varTextShort}}}}|\n|0}}<!-- -->}}<!-- ifexpr -->|<!-- if there is one paragraph or less -->{{#ifexpr: {{#lenvar: {{{vartext|}}}|varLen}} > 1000|997<!-- -->|{{#sub: {{{vartext|}#var: varTextShort}}|0|997}}&#2018230;<!-- -->|{{{vartext|}#var: varTextShort}}<!--
-->}}<!-- ifexpr
-->}}<!-- if
--></includeonly>