Template:Dialog/psub

From Wikinews, the free news source you can write!
Jump to navigation Jump to search
[edit] Template-info.svg Template documentation

This template simulates substitution of incoming dialog parameters for template parameters in a wiki text.

Usage

Specify the wiki text through template parameter text. Specify the name and value of an incoming dialog parameter through template parameters nk and vk for integer k in the range from 1 to 20 (as of this writing).

{{Dialog/psub|text=foo{{{bar}}}quux|n1=bar|v1=baz}}

would expand to

foobazquux

Template parameters are only substituted for if their default value in text does not contain any nested curly braces; thus, given markup {{{foo|{{{bar|quux}}}}}}, incoming dialog parameter bar would be substituted for, but not incoming dialog parameter foo. (This faithfully reproduces a limitation of dialog substitution for incoming dialog parameters.)

Reserved dialog parameters are not automatically handled.

If the value substituted for a parameter contains certain characters with format meaning in wiki markup, those characters are not naively substituted in, but instead are replaced by wiki markup for calls to suitable character-substitution templates, just as dialog substitution does to preserve parse structure.

{{Dialog/psub|text=foo{{{bar}}}quux|n1=bar|v1=<>}}

would expand to

foo{{(\}}{{\)}}quux

See also
https://en.wikinews.org/wiki/Template:Dialog/psub
en.wikinews.org
crawl=CC-MAIN-2018-51
31336
application/http; msgtype=response
sha1:TGOMLTCVOWL7UXKYM3DZ7EUJKPWIVSEH
<urn:uuid:2ce08cb1-6b7d-460d-a458-844d9daf86b2>
2018-12-14T12:07:28Z
208.80.154.224
text/html
sha1:OEYVLA3MVH3GQZLWUHQY56BLGDD72JIN
<urn:uuid:492b9946-eeff-418a-b15c-58ad192f3d8f>
https://en.wikinews.org/wiki/Template:Dialog/psub
response
<urn:uuid:447d9efa-aada-4924-8147-38341a4bcbb4>
isPartOf: CC-MAIN-2018-51
publisher: Common Crawl
description: Wide crawl of the web for December 2018
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-102-177-182.ec2.internal
software: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/