साँचा:Nowrap/विव

विकिपुस्तक से
नेविगेशन पर जाएँ खोज पर जाएँ


This is the {{nowrap}} template.

This template prevents word wraps (line breaks) in text and links that contain spaces.

Usage[सम्पादन]

Lots of text {{nowrap|10 kg (22 lb)}} more text.

It may render like this:

Lots of text 10 kg (22 lb)
more text.

Or like this:

Lots of text
10 kg (22 lb) more text.

But it will not render like this:

Lots of text 10 kg (22
lb) more text.

Handling interpreted characters[सम्पादन]

Templates have problems to handle parameter data that contains equal signs "=" or vertical bars "|". In such cases consider using {{nowrap begin}} + {{nowrap end}} instead. But there are also workarounds:

For text that includes an equal sign "=", precede the text with 1=. For example:

{{nowrap|1=2 + 2 = 4}}

Which renders this:

2 + 2 = 4

For text that includes a vertical bar "|", escape the bar(s) with &#124; or {{!}}. For instance like this:

{{nowrap|&#124;2&#124; < 3}}

Or like this:

{{nowrap|{{!}}2{{!}} < 3}}

Which renders this:

|2| < 3

Technical details[सम्पादन]

The actual code that does the job is this HTML+CSS code:

<span style="white-space:nowrap;">This text will not wrap</span>

Spaces at the beginning or end of your text will fall outside the no-wrap tag in the rendered text due to MediaWiki rendering mechanisms.

See also[सम्पादन]

  • {{nowraplinks}} - Prevents wraps inside links and only allows wraps between the links and in normal text. Very useful for link lists and easy to use.
https://hi.wikibooks.org/wiki/%E0%A4%B8%E0%A4%BE%E0%A4%81%E0%A4%9A%E0%A4%BE:Nowrap/%E0%A4%B5%E0%A4%BF%E0%A4%B5
hi.wikibooks.org
crawl=CC-MAIN-2022-21
39440
application/http; msgtype=response
sha1:Y3HMMJ5OSICGG5CH5SD22EBRYKCQ6DYD
<urn:uuid:c1b7b505-6c4f-4a19-b2ac-432c05bbe952>
2022-05-23T14:04:06Z
208.80.154.224
text/html
sha1:CC6QLBBRO7HWJGGKSY4SBC2N5GYIG5R4
<urn:uuid:77139977-ea97-48f2-80f1-c2ea2239602e>
https://hi.wikibooks.org/wiki/%E0%A4%B8%E0%A4%BE%E0%A4%81%E0%A4%9A%E0%A4%BE:Nowrap/%E0%A4%B5%E0%A4%BF%E0%A4%B5
response
<urn:uuid:120303e9-26ab-4380-b0b0-ba9cc98d4cd4>
isPartOf: CC-MAIN-2022-21
publisher: Common Crawl
description: Wide crawl of the web for May 2022
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-26
software: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/