[Pmwiki-users] Single space breaking page format (was: Idea for extension of special

chr@home.se chr
Sat Jan 22 08:12:28 CST 2005


On Fri, 21 Jan 2005, Patrick R. Michaud wrote:

> > However, see my message about how a single space on the beginning of a 
> > page can break the layout of the whole page by making it too wide :-(
> 
> I'm not sure what can be done about this.  If it's preformatted text,
> then PmWiki has no business adding linebreaks where they don't appear
> in the markup.

I know... my main irritation is that it can be very difficult to find this
minute error. This can actually be so irritating that I'd like to disable 
preformatted text for such pages. Could that be an option?

Another option could be something (a directive for instance) that 
changes the n:o spaces required to trigger preformatted text. For 
instance, here's the default behaviour

	A text with no starting space (NOT preformatted).
	 A line with one starting space (preformatted)
	  A line with two starting spaces (preformatted)
	   A line with three starting spaces (preformatted)
	    A line with four starting spaces  (preformatted)

However, by using a directive we can change the behaviour like this

	(:preformat-threshold 3:)
	A text with no starting space (NOT preformatted).
	 A line with one starting space (NOT preformatted)
	  A line with two starting spaces (NOT preformatted)
	   A line with three starting spaces (preformatted)
	    A line with four starting spaces  (preformatted)

I'm not sure how easy it'd be to implement this functionality though.

Btw, how difficult is it to make pmwiki parse "extra" text? I was thinking 
that if you'd want to do the above using config.php, it could be done 
using something like this:

	prepend-current-page-with-text("(:preformat-threshold 3:)\n");

which would make pmwiki interpret the string above and treat it just like 
as if it was at the beginning of the wiki page.  The advantage with this 
is that the administrator only has to learn one "syntax" (instead of 
trying to figure out what variable to set in order to do the above).

/Christian

-- 
Christian Ridderstr?m, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list