[pmwiki-devel] Minor conflict between (:linebreaks:) and white-space=pre
Patrick R. Michaud
pmichaud at pobox.com
Sun Feb 4 10:24:01 CST 2007
On Sat, Feb 03, 2007 at 01:11:57PM +0100, christian.ridderstrom at gmail.com wrote:
> If you use both (:linebreaks:) and white-space=pre, you get double line
> breaks. Is this really what should happen?
>
> See here for a test case:
> http://pmwiki.org/wiki/Test/LinebreaksAndWhitespacePre
Short answer: Yes, it's really what should happen.
Longer answer: I don't think PmWiki should be responsible for trying
to figure out when a CSS style is going change the interpretation of
newlines. Suppose we define a wikistyle of "foo", and an external
CSS definition somewhere has ".foo { white-space:pre; }" in it.
Should PmWiki then be responsible for figuring out that the
<br /> tags (inserted by (:linebreaks:)) should be suppressed
because the text is in a ".foo" section?
If it's really important, I suggest using CSS to fix the problem,
so that <br /> tags within >>pre<< sections are hidden.
.pre { white-space:pre; }
.pre br { display:none; }
> PS. Maybe we should look at the possibility of using unit test for PmWiki.
> Perhaps together with some minimal skin on the full page, or perhaps
> something similar to (:markup:)..(:markupend:) where we can specify the
> expected outtput.
I've done some experiments with unit testing of PmWiki a few times
before (notably with the early versions of 2.0), but I found it hard
to build the tests and keep up with them. I can see about setting
up some testing pages again, however. It'd likely be much simpler
now that we have more advanced pagelist capabilities.
Pm
More information about the pmwiki-devel
mailing list