Difference between revisions of "Template:PrintFirstParagraph"
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
-->|<!-- if there is one paragraph or less | -->|<!-- if there is one paragraph or less | ||
--><!-- | --><!-- | ||
− | -->{{#vardefine: varLen|{{#len: {{{vartext|}}} | + | -->{{#vardefine: varLen|{{#len: {{{vartext|}}} }}|}}<!-- |
− | --><!-- | + | -->{{#var: varLen}}<!-- |
-->{{#ifexpr: {{#var: varLen}} > 1000<!-- | -->{{#ifexpr: {{#var: varLen}} > 1000<!-- | ||
− | -->|{{#sub: {{{vartext|}}}|0|997}}<!-- | + | -->|greater{{#sub: {{{vartext|}}}|0|997}}<!-- |
− | -->|{{{vartext|}}}<!-- | + | -->|less{{{vartext|}}}<!-- |
-->}}<!-- ifexpr | -->}}<!-- ifexpr | ||
-->}}<!-- if | -->}}<!-- if | ||
--></includeonly> | --></includeonly> |
Revision as of 00:07, 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.