[Pmwiki-users] Markup to prevent parsing of indented(PRE) text

Val Sharp val
Tue Nov 2 03:33:02 CST 2004


Patrick R. Michaud, on 01.11.04 19:21, wrote:

> On Mon, Nov 01, 2004 at 06:38:42PM +0000, Val Sharp wrote:
> 
>>I was surprised to discover that indented text (i.e. rendered as a 
>><pre> element) is still being parsed for PmWiki markup, so I had a go 
>>at creating something to prevent that:
>>
>>  Markup('^ [=','<\\r','/^ (.*?)$/',' [=$1=]');
>>
>>It seems to do the job, but since I'm new to PmWiki and php reg 
>>expressions, etc, I just thought I'd check it's not likely to have any 
>>unforeseen consequences.
> 
> 
> If you just want to disable the "spaces-at-beginning-of-line generate <pre>
> text", ...

No, I still wanted to parse "spaces-at-beginning-of-line" as a <pre> 
element, but I was mostly using it for sample code on a page, so I 
wanted the text to be rendered literally, i.e. just as it's typed.

I'd given up on @@ and [@ because they were collapsing whitespace (and 
meant extra typing too ... how lazy can one get!), but of course 
that's what I should probably have been using - and having just done a 
rethink, setting 'code {white-space:pre;}' seems to have produced what 
I want, so I shall abandon my wonderful Markup for 
"spaces-at-beginning-of-line" and use [@ ... @] after all.

Still, I suppose it was all good practice   :-)

-- 
Best regards,
Val Sharp - Edinburgh



More information about the pmwiki-users mailing list