NoWrap

<< | Cookbook-V1 | >>

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Question

How can I create strings that aren't broken for line wrapping?

Answer

Add the following to a local customization file:

    $WikiStyleTags['white-space'] = 
        array('style' => 'white-space:$value; ');
    $WikiStyle['nowrap']['white-space'] = 'nowrap';

This will add a %nowrap% WikiStyle? that can be used to prevent line wrapping in text. Line breaks using \\ and [[<<]] are still honored.

Example

In the markup below, the %nowrap% WikiStyle? around the second sentence prevents linebreaks from occurring anywhere in that sentence.

 
Lorem ipsum dolor sit amet, consectetuer adipiscing 
elit.  %nowrap%In sit amet ante quis mi scelerisque imperdiet.%%
Quisque tristique lorem in risus.  Proin semper bibendum augue. 

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In sit amet ante quis mi scelerisque imperdiet. Quisque tristique lorem in risus. Proin semper bibendum augue.

Contributors

Sandbox

Feel free to play with the %nowrap% style here.

This is nowrap
with a line break in the middle.

With %nowrap%

The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog

Without %nowrap%

The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog pmwiki-2.3.32 -- Last modified by {{LarryBaltz}}

from IP: 85.171.160.186 ip should be disabled by default for security reasons