Plantilla:Nowrap begin

De Wikipedia, la enciclopedia libre


Icono de documentación de plantilla Documentación de la plantilla[ver] [editar] [historial] [purgar]

Uso

Esta plantilla previene saltos de palabra (saltos de linea) en textos y enlaces con espacios dentro. Está diseñada para manipular los casos de saltos realmente delicados donde se necesite control total. Por ejemplo en listas de enlaces muy largas. Funciona de forma similar a {{nowrap}}.

Esta plantilla no lleva parámetros, en su lugar funciona junto con {{nowrap end}}.

Plantillas ayudantes

Esta plantilla tiene un número de plantillas ayudantes que permiten decirle al explorador web exactamente donde insertar los saltos de linea:

Nota! Estas plantillas ayudantes deben ser usadas solo en secciones rodeadas por {{nowrap begin}} y {{nowrap end}} o podrían causar historias raras en tu página.

  • {{wrap}} - Marca donde debe ir un salto.
  • {{·wrap}} ó {{·w}} - Looks like this: " · ". For dotted lists. Renders a bold middot surrounded by spaces and then marks that a wrap may occur after the midddot.

Uso

{{nowrap begin}}

[[Salt]] and{{wrap}} [[Pepper]] and{{wrap}} [[Curry]] 
and{{wrap}} [[Saffron]].{{wrap}} 
[[Salt]] and{{wrap}} [[Pepper]] and{{wrap}} [[Curry]] 
and{{wrap}} [[Saffron]]. 

{{nowrap end}}

It will render something like this:

Salt and Pepper and Curry and
Saffron. Salt and Pepper and
Curry and Saffron.

But it will not render like this:

Salt and Pepper and Curry
and Saffron. Salt and Pepper
and Curry and Saffron.

To make your code readable and easy to edit, you can put each wrappable "line" on its own line. And let's use some dots too. Like this:

{{nowrap begin}}

[[Salt]] and [[Pepper]]{{·wrap}} 
[[Pepper]] and [[Curry]]{{·wrap}} 
[[Curry]] and [[Saffron]]{{·wrap}} 
[[Saffron]] and [[Salt]]

{{nowrap end}}

It will render something like this:

Salt and Pepper · Pepper and Curry ·
Curry and Saffron · Saffron and Salt

But it will not render like this:

Salt and Pepper · Pepper
and Curry · Curry and Saffron
· Saffron and Salt

Ejemplos

Here are the above examples in actual running code in a table. Try dragging the width of your web browser window so it becomes smaller and smaller and watch how the line wrapping behaves:

Salt and Pepper and Curry and Saffron. Salt and Pepper and Curry and Saffron.

Salt and Pepper · Pepper and Curry · Curry and Saffron · Saffron and Salt

Detalles técnicos

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

<span style="white-space:nowrap;"> Text and links </span> <span style="white-space:nowrap;"> More text and links </span>

It means that wraps may only happen in the unprotected space between the </span> and the <span ...>. That's what {{nowrap begin}} and its helper templates are packaging in an easy to use way.

{{·wrap}} and the other helper templates should not have any spaces or newlines before them or they will render two spaces before the dot. They tolerate anything from no to several spaces and even a newline after them and they will still only render one space after the dot. If a wrap occurs then the wrap will come after the dot, even if there are spaces before the helper template.

The {{·wrap}} causes problems if inside sections of bolded and/or italicised text. Do end the bold text before the {{·wrap}} and continue the bold text after it to avoid the problems.

Véase también

  • {{nowrap end}} - The other end of this template.
  • {{nowrap}} - A template with similar purpose.
Esta documentación está transcluida desde Plantilla:Nowrap begin/doc.
Los editores pueden experimentar en la zona de pruebas (crear) y en los casos de prueba (crear) de la plantilla.
Por favor, añade las categorías en la subpágina de documentación. Subpáginas de esta plantilla.