00488: percents in WikiStyles don't work

Summary: percents in WikiStyles don't work
Created: 2005-08-05 04:17
Status: closed - workaround in 2.1.0
Category: Bug
From: Mateusz
Assigned:
Priority: 4
Version: 2.0beta55
OS: pmwiki.org too

Description:

As I've demonstrated in TestStyles, the WikiStyles markup doesn't properly parse styles containing: a dot (therefore, non-integers crash whole style definition), and a percent sign (ends the style definition prematurely).

Pm already turned fractions on in 2.0beta55.

Suggestion:

Considering percents: I believe it's possible to extend regexps in scripts/wikistyles.php in such a way, that strings in apostrophes and quotes were considered separately. That is (simplyfing), not something like:

  /%[^%]*%/ 
Explained: percent, followed by not-percents, followed by percent

but more of a:

  /%([^%]|"[^"]")*%/ 
Explained: percent, followed by some not-percents and some strings, followed by a percent - where a string is a quote, followed by not-quotes, followed by a quote (note, that a string can have a %)

However, when I looked at wikistyles.php, I found there are more regexps to modify than simply $WikiStylePattern... aargh... is it possible for a human to modify that?...


It's not quite this simple, because we can't assume that every % is indicating a wikistyle. Sometimes a percent is just a %, and we don't want to assume that anything that is in a pair of percent signs is automatically a wikistyle (as happens in this line).

--Pm


Suspending because it's a difficult problem to solve -- need more high-priority votes to reactivate. --Pm


I've gone ahead and enabled "pct" as a synonym for "%" in wikistyles, thus someone who wants to specify width=50% can use width=50pct. Added for 2.1.beta1.