[pmwiki-users] Problem with CR/LF (or auto-BR)

Hans design5 at softflow.co.uk
Tue Mar 13 03:44:35 CDT 2007


Tuesday, March 13, 2007, 8:34:00 AM, EXT wrote:

> Sometimes, when creating a new wiki page by copy/paste text (for example
> form an existing web page), special (invisible) characters seem to be
> put in the new article.

> And after saving the page, it is displayed in a very large width, and
> the users have to scroll.

> Why automatic carriage return characters (usually ok) are disabled ?

> (I use $HTMLPNewline = '<br />'; to avoid the '\\' code)

The wide lines are produced by <pre> tags being applied to text which
has one or several empty spaces at the beginning of the line.
This si done by the PmWiki markup for whitespace.
You can disable it with

  DisableMarkup('^ws');

If you wish to preserve the first line indent an author intended by
placing one or several empty spaces at the line start, you could try
this (in addition to the above and the $HTMLPNewline = '<br />';):

  $HTMLStylesFmt[]=" p.firstlineindent {text-indent:4em} \n";
  Markup('^  ','block','/^(\\s+)(.*)/',
       "<:block,1><p class='firstlineindent'>$2</p>");

This will convert the paragraph by removing any empty spaces at line
start and applying a class=firstlineindent, which you could change to
your liking.


Hans




More information about the pmwiki-users mailing list