[Moin-user] [PATCH] Some HTML 4.01 validity issues with Moin

Martin Wilck martin.wilck at fujitsu-siemens.com
Thu Feb 16 14:33:04 EST 2006


Hi,

I just ran the W3C validator (http://validator/w3.org) over my Wiki, and 
found some problems. As Moin claims to generate valid HTML 4.01 strict, 
I though I might report this here. The MoinMoinBugs page doesn't work 
currently (see my last post), therefore I am sending this mail.

Issue #1: wrong </p> tags.

Under some circumstances, Moin inserts </p> tags where the <p> is 
already implicity closed. A sample Wiki code to produce this error is

## start
some text
[[NewPage()]]
## end

Moin generates <p>some text <form>....</form></p>, but that's wrong in 
HTML because "<p> can't contain any block elements", thus <p> is 
implicitly closed when <form> starts 
(http://www.w3.org/TR/html401/struct/text.html#edef-P)

Solution:
The problem can be overcome by adding the "p" element to the set of 
self-closing tags. I saw no negative consequences of that change.


Issue #2: The W3C validator doesn't like <ol type="1">

The "type" and "start" attributes of <ol> are deprecated and accepted by 
the validator only in "transitional" documents. This makes all Moin 
pages with numbered lists invalid HTML 4.01 (strict). Example: check 
HelpOnLists in the validator.

Solution:
For "type", the attribute can easily be converted to 
'style="list-style-type: X' form, which most browsers support.

Wrt "start", there seems to be no workaround with acceptable Browser 
support. "counter-reset:" is only supported by Opera, AFAIK. So Wiki 
pages using " 1.##10 item" won't validate, but those are fortunately 
only a few.

Issue #3: line anchors are not allowed in tables

With line anchors on, Moin generates HTML like this:
<tbody><
<span id="line-31"></span><tr><td>cell....</td></tr>

This is invalid because <span> isn't allowed inside <table>, <tbody>, 
and <tr>. Example: Check HelpOnTables.

Solution:
I made a modification that puts the <span> in the first table cell:
<tr><td><spanid="line-31">cell ...</td></tr>

That seems to work, but I am unsure if it can have negative consequences 
on some parts of moin that assume the <span>s mark the very beginning of 
the line(s), perhaps the GUI editor? Anyway it's worth a try, because 
otherwise Moin's "Valid HTML 4.01" claim would break for every page 
containing tables.

Please see patch for all 3 problems atttached.

Regards
Martin

-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1        mailto:Martin.Wilck at Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: moin.diff
Type: text/x-patch
Size: 3643 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/moin-user/attachments/20060216/f2486ee1/attachment.bin>


More information about the Moin-user mailing list